I I am trying to convert php links with variables to html link so increase seo of my site,

My links are like:
http://site.com/pages/page1.php?v1=var1&v2=var2&v3=var3&v4=var4

or:

http://site.com/pages/page1.var1.var2.var3.var4.html

or some things like that it doesn't matter but the point is how to do that and alos be able to GET those variable values? please explaine completely ... PLEASE

Recommended Answers

If you are hosting on an Apache server you can use the .htaccess file for creating "friendly URLs".

Here are a couple of links that should get you started
http://zenverse.net/seo-friendly-urls-with-htaccess/

Jump to Post

All 4 Replies

my .htaccess file contains :

Options +FollowSymLinks

RewriteEngine On


Options +FollowSymLinks

RewriteEngine On
RewriteRule ^test-([0-9]+)\.html$ test.php?id=$1

ErrorDocument 404 /notfound.htm

and this is my link
<a href="test.php?id=45">click</a>

still the same problem ! i didn't get notice !

It is probably working if you put in the friendly url into your address bar. The rewrite rule in htaccess is going to rewrite (interpret) the friendly url for you to the correct page, it isn't going to redirect all of your links to the friendly url. You would either need to change your links to point to friendly urls or do a 301 redirect to the friendly urls. You could do that in htaccess or you could use PHP to parse the request uri and redirect accordingly

thanks for ur answer
but 1 more question => RewriteRule ^test-([0-9]+).html$ test.php?id=$1
as u can see in this rule i have one variable ($1) that it can be anything that i want and it is ok
but if i want to change (test) to variable what should i do ?
because i have too many links and it takes many time to insert them one by one into .htaccess file ?
could u help me with this ?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.20 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.