Forum Moderators: phranque

Message Too Old, No Replies

rewrite rule to skip folder

rewrite rule to skip folder

         

repo

3:01 am on Feb 11, 2011 (gmt 0)

10+ Year Member



New poster guys so go easy on me please, i freely admit I am not an expert on anything but I get lucky alot.

So what I was wondering is if someone could please help me with an httaccess rewrite that I am not sure is even possible.

what i have is a social network site that gives the users accounts that are domain.com/profile/username

I bought a mod for it that makes the profiles domain.com/username the problem is some of the links on the site still point to .com/profile/username/...

Is there a global solution that would just skip the profile folder no matter what link they clicked?

Sorry if I didn't explain that well if not I will try again.

repo

3:08 am on Feb 11, 2011 (gmt 0)

10+ Year Member



I did try getting support from the guy i bought it from but it has been 4 days and still no answer, just thought I would throw that out there.

jdMorgan

8:00 pm on Feb 17, 2011 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Do you have other working mod_rewrite rules?

If so, then add

RewriteCond %{THE_REQUEST} ^[A-Z]+\ /profile/[^\ ]+\ HTTP/
RewriteRule ^profile/(.+)$ http://www.example.com/$1 [R=301,L]

After any more-specific external redirect rules, before any less-specific external redirect rules, and before any internal rewrite rules.

Otherwise, you will need to add the directives to set up and enable mod_rewrite, and you will need to convert any pre-existing Redirect and/or RedirectMatch directives to use mod_rewrite RewriteRule instead.

Jim