Results 1 to 2 of 2
I need to direct all visitors that enter my /old top directory to be redirected to my home index page. This would include every single file in the old directory ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
- 04-09-2010 #1
- Join Date
- Apr 2010
Need wildcard mod_rewrite
I have used cpanel for this initially, but I find that for a simple 301 redirect for one file the coding is too complex and ultimately doesn't work anyways. Even the wildcard setting does not work, so I have always felt comfortable doing my own mods and besides it's even better for SEO.
I have experimented with many different mods that should work but don't such as:
Redirect 301 /my_directory/ homepage URL
RedirectMatch 301 /my_directory(.*) /$1
RedirectMatch 301 ^/my_directory/(.*)$homepage URL/$1
Now keep in mind I do have an .htaccess file in this top directory and there was a suggestion in another forum to place this mod in this file while doing a standard 301 redirect in the root directory:
This does not work either.
RewriteRule ^my_directory/(.*)$ /$1 [R=301,NC,L]
There must be somebody in this community that has done this sucessfull wildcard redirect for a top directory.
- 04-14-2010 #2linux user # 503963