.htaccess - Add subdirectory to url in htaccess -


i'm trying add subdirectory url. example, /news must go /blog/news including articles

i came this:

rewritecond %{request_uri} !^/news/.*$ rewriterule ^(.*)$ /blog/news/$1 [r,l] 

see below fix!

i fixed following rule:

rewriterule ^news/(.*)$ /blog/news/$1 [r=301,nc,l] 

make sure clear cache when testing , set r=302 make temporary redirect. set r=301 once know working.


Comments

Popular posts from this blog

networking - Vagrant-provisioned VirtualBox VM is not reachable from Ubuntu host -

c# - ASP.NET Core - There is already an object named 'AspNetRoles' in the database -

ruby on rails - ArgumentError: Missing host to link to! Please provide the :host parameter, set default_url_options[:host], or set :only_path to true -