I need to do this:
I have an old URL:
http://www.mysite.com/dev-site/some-content-part-here
That I want to make into:
http://www.mysite.com/live/some-content-part-here
I found somebody voted down on my question. I dont know what thought drove him/her to that but actually the question really was not that silly! May be the downer did not understand why I asked this... it could be anything in his mind. But I want all readers, if you dont like question - please always try to communicate through comments and then if the question poster does not agree your changes, then down vote. Thanks.
*And guys, thanks for editing.
The $1 is basically the captured contents of everything from the start and the end of the string. In other words, $1 = (. *) .
A rewrite rule can be invoked in httpd. conf or in . htaccess . The path generated by a rewrite rule can include a query string, or can lead to internal sub-processing, external request redirection, or internal proxy throughput.
a2enmod = Apache2 Enabled ModThe a2enmod command actually moves the Apache module files from /etc/apache2/mods-available to /etc/apache2/mods-enabled. The second method is to manually move the module files ourselves.
Untested:
RewriteEngine On
RewriteRule ^/dev-site/(.*)$ http://www.mysite.com/live/$1 [R=301,L]
Note that it might work if you only use /live/$1
on the right hand side, but I'd do this to be sure.
I know you know this (since you've mentioned mod_rewrite), but for those that don't, you generally put this into the .htaccess
file in the directory - either dev-site
or root should work.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With