Kevin
Kevin

Reputation: 2688

.htaccess Rewrite URL instead of Redirect

Is it possible to Do this rewrite without it redirecting?

# redirect for the blog link
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^topgearsblog/?$ http://aerogearblog.wordpress.com/ [NC,L]

I've tried it like:

# redirect for the blog link
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^topgearsblog/?$ http://myblog.wordpress.com/ [L,QSA,NC]

and it still redirects instead of rewrites.

Upvotes: 1

Views: 65

Answers (1)

anubhava
anubhava

Reputation: 785246

It is possible only if you enable mod_proxy in you Apache config. Once it is enabled you can do:

# redirect for the blog link
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^topgearsblog/?$ http://aerogearblog.wordpress.com/ [NC,L,P]

Upvotes: 1

Related Questions