Hi,
How are the rules used in .htaccess to convert
this: www.example.com/example.php?x=1
in this: www.example.com/1
Thanks.
Options +FollowSymLinks
RewriteEngine On
RewriteRule ^([0-9]+)/?$ /example.php?x=$1 [QSA,L]
richardk wrote:Try
- Code: Select all
Options +FollowSymLinks
RewriteEngine On
RewriteRule ^([0-9]+)/?$ /example.php?x=$1 [QSA,L]
freews wrote:How are the rules used in .htaccess to convert
this: www.example.com/example.php?x=1
in this: www.example.com/1
richardk wrote:You are supposed to edit your script so that it does output the friendly URLs, then you might gain something. The mod_rewrite is only a small part of it.
do you mean I should edit the blog script? As a user and not a programmer, that's not likely to happen.
But if I were able to edit the blog script so it output friendly urls, why would I need a mod rewrite?
It would be nice if we could redirect a user to a certain url but send the search engine a redirect of a completely different form.
domain.com/example/more_stuff/my_item
The different folder levels would help to display the right page, yet the search engine would get a hard redirect/permanently moved for:
domain.com/my_item
Options +FollowSymLinks
RewriteEngine On
RewriteCond %{HTTP_USER_AGENT} googlebot|slurp [NC]
RewriteRule ^example/more_stuff/my_item/?$ /my_item [R=301,L]
Return to Friendly URLs with Mod_Rewrite
Users browsing this forum: No registered users and 97 guests