Replace // with / in url

Discuss practical ways rearrange URLs using mod_rewrite.

Replace // with / in url

Postby AfanTheOne » Tue Nov 04, 2003 6:55 am

I am having trouble figuring out how to replace // with a / in a url, then having apache redirect the user.

If the user enters http://www.site.com//file i want them to be sent to http://www.site.com/file

The reason I need to do this is because the // causes all of my php files to malfunction, and it would take a lot of time to modify all of the php files.


Thanks
AfanTheOne
 

Postby AfanTheOne » Fri Nov 14, 2003 7:07 am

Since no one gave me any help I was forced to figure it out on my own. However, since I am a nice guy I am sharing it. Just in case someone else may find it useful.

RewriteRule ^/{2,4}([a-z.A-Z0-9]*) $1 [R,L]

8)
AfanTheOne
 


Return to Friendly URLs with Mod_Rewrite

Who is online

Users browsing this forum: No registered users and 18 guests

cron