Mobile app version of vmapp.org
Login or Join

Login to follow query

More posts by @Angie530

3 Comments

Sorted by latest first Latest Oldest Best

 

@Deb1703797

This will work if your server is apache with mod_rewrite enabled:

RewriteEngine On
RewriteRule ^photo(.*)$ www.example.com/blog/ [R=301,L]


and if upper or lower case characters are acceptable, then use this:

RewriteEngine On
RewriteRule ^photo(.*)$ www.example.com/blog/ [R=301,L,NC]


Because of the redirect, I'd recommend using the full absolute URL to redirect to instead of a relative URL because an rfc document (I forgot the rfc number) once stated that the Location header on a redirect page must be a full absolute URL but then another rfc document later stated the URL can be relative, but if you want to increase compatibility for every web browser, I'd suggest using absolute URLs for all redirects.

10% popularity Vote Up Vote Down


 

@Kristi941

I found out:

RedirectMatch 301 ^/photo/ www.example.com/blog/

10% popularity Vote Up Vote Down


 

@Eichhorn148

You don't even need a regular expression. The Redirect directive handles that case easily:

redirect permanent /photo/ www.example.net/blog/ redirect permanent /photo www.example.net/blog

in the .htaccess file for the example.com server. By default, the redirect directive saves anything additional on the path (/photos/hello) and appends it to the destination (/blog/hello).

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme