I am trying to create a modrewrite rule that will change:
to not always What is the best way to do this? After enable mod_rewrite and This will be internally forwarded to / Blah / right / xyz.htm
/correct/xyz.htm
Blah but when it's there, it always appears in the beginning of the URL. URL can be any length with many sub-paths, it may also be
/blah/myfile.htm (which should only be rewritten to
/myfile.htm ).
.htaccess via httpd.conf and then Put this code under your code in your
.htaccess DOCUMENT_ROOT directory:
option + RewriteBase / RewriteRule RewriteEngine ON (Turn on FollowSymLinks -MultiViews # Mod_rewrite ?: ^ | /) blah (/.+)$ / $ 1 [L, nc]
/ blah / foo / foo or
/ blah / correct / foo to
/ correct / foo . If you want external rewrite then use:
rewrite (: ^ | /) blah (/.+)$ / $ 1 [L, R = 301, nc]
No comments:
Post a Comment