the traditional mod_rewrite. I can not appear to have it right.
Typical scenario: A person types in "http://domain.com/page" I would like the user has been rerouted to "http://domain.com/page/page2"
My htaccess file looks the following:
RewriteEngine on RewriteBase /var/www/ RewriteRule ^/page/$ page/page2 RewriteRule ^/bla/$ page/page2/bla
The very first rewrite rule works, the 2nd however does not appear to work. Any idea? Maybe an easy method to get this done?
And the other question: When I stated the very first rewrite works all right, however the url isn't pretty. "http://domain.com/page" changes to "http://domain.com/page/page2". It is possible to method to keep your entered url but nonetheless forward the consumer towards the actual link?
I presume the
.htaccess is within your DocumentRoot.
So how exactly does your
/bla that contains seem like? This will not rewrite the URL within the browser.
Make use of this:
RewriteEngine on RewriteBase / RewriteRule ^(/?)page/?$ $1page/page2 [L] RewriteRule ^(/?)bla/?$ $1page/page2/bla [L]