|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Newbie question - URL rewrite
Hi there,
I've had a llok thru a lot of forums, but can't seem to find the answer to this one... So, correct me if I'm wrong, but my site will rank better with non-php URLs, so I am trying to implement a URL rewrite. This is the code I have put in my htaccess file: Options +FollowSymLinks RewriteEngine on RewriteRule artist-name-(.*)\.htm$ artist.php?name=$1 with my php url being: /artist.php?name=Mr%20Jones My first issue seems to be that the rewrite doesnt seem to work. I have PHP 5.2.4, running on an apache 1.3.41 server, anyone got any ideas? No clues where to start.... Thanks |
|
#2
|
||||
|
||||
|
I'll take a stab at it - you need to provide a rewrite condition before a rule can be applied - maybe something like;
Options +FollowSymLinks RewriteEngine on RewriteCond %{REQUEST_URI} ^.*artist\.php RewriteCond %{QUERY_STRING} ^a=([^&]+)$ RewriteRule ^.*$ /artist-name/%1.html [R=301,L] *crosses fingers*
__________________
Keyword Meta Questions Answered HTAccess Redirects Adversity is a spice when added to life makes the dish more interesting. A magic marker is a SEO's "Easy Button". |
|
#3
|
|||
|
|||
|
Nah, still no love
Anything else I might try? |
|
#4
|
|||
|
|||
|
Small change
Try this one:
Options +FollowSymLinks RewriteEngine on RewriteRule artist-name-([^/]+)\.htm$ artist.php?name=$1 .* should work, too, but sometimes I have better luck with this. Also keep in mind that they goal is not to get rid of .php. Search engines don't mind that stuff. But you want to keep the query parameters low and, more importantly, have keywords in you URL. And that's what this should help you with. But you could leave the .php instead of replacing it with .htm. Also, do you know for a fact that the rewrite engine is working? Do you see activity in the rewrite log? I think you have it turned off, so you may want to add "RewriteLogLevel 3" to this and check the log. |
|
#5
|
|||
|
|||
|
Yeah, that should work.
|
![]() |
| Viewing: SEO Chat Forums > Google > Google Optimization > Newbie question - URL rewrite |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|