please rewrite this

Discuss practical ways rearrange URLs using mod_rewrite.

please rewrite this

Postby celebritywallpaper.us » Sun Jul 20, 2008 8:13 pm

hi


Code: Select all
RewriteRule ^profile/(.*).html profile.php?u=$1


how to allow user have space between user name...

if the user name "hello world" and the url display like this

Code: Select all
http://www.mydomain.com/profile/hell-world.html
above is not working...404 error
celebritywallpaper.us
 
Posts: 41
Joined: Sat Feb 03, 2007 6:27 am

Postby richardk » Tue Jul 22, 2008 9:56 am

Try
Code: Select all
Options +FollowSymLinks -MultiViews

RewriteEngine On

RewriteRule ^profile/([^/]+)\.html$ /profile.php?u=$1 [QSA,L]


Do you have any other rules?
richardk
 
Posts: 8800
Joined: Wed Dec 21, 2005 7:50 am

Postby celebritywallpaper.us » Tue Jul 22, 2008 10:38 am

i still got the same error

If i use this
RewriteRule ^profile/([0-9]+)/([_A-Za-z0-9-]+).html profile.php?u=$1 [L]
i got an error like this

Code: Select all
Multiple Choices
The document name you requested (/profile/hello-world.html) could not be found on this server. However, we found documents with names similar to the one you requested.
Available documents:

/profile.php/hello-world.html (common basename)


my url design look like this
Code: Select all
http://www.mydomain.com/profile/hello-world.html


how i remove .php?

Thanks advance
celebritywallpaper.us
 
Posts: 41
Joined: Sat Feb 03, 2007 6:27 am

Postby richardk » Tue Jul 22, 2008 10:42 am

That happens with "-MultiViews"?
richardk
 
Posts: 8800
Joined: Wed Dec 21, 2005 7:50 am

Postby celebritywallpaper.us » Tue Jul 22, 2008 1:15 pm

yes


Code: Select all
RewriteRule ^profile/([0-9]+)/([_A-Za-z0-9-]+).html profile.php?u=$1 [L]


remove .php?


Code: Select all
RewriteRule ^profile/([0-9]+)/([_A-Za-z0-9-]+).html  [L]


still not working
celebritywallpaper.us
 
Posts: 41
Joined: Sat Feb 03, 2007 6:27 am

Postby richardk » Wed Jul 23, 2008 7:33 am

Try
Code: Select all
Options +FollowSymLinks -MultiViews

RewriteEngine On

RewriteRule ^profile/([0-9]+)/[^/]+\.html$ /profile.php?u=$1 [QSA,L]


Or if that doesn't work, rename profile.php.
richardk
 
Posts: 8800
Joined: Wed Dec 21, 2005 7:50 am


Return to Friendly URLs with Mod_Rewrite

Who is online

Users browsing this forum: No registered users and 48 guests

cron