Welcome to WebmasterWorld Guest from 54.196.153.46

Forum Moderators: Ocean10000 & incrediBILL & phranque

Message Too Old, No Replies

301 for complete folder

tried it all

     
9:06 pm on Jul 13, 2005 (gmt 0)

Junior Member

10+ Year Member

joined:Dec 14, 2004
posts:41
votes: 0


I have accomplished rewrite of the problem with "with www and without www". I thought the next step would be easy for me - I was wrong.

I can't seem to work out how to redirect a all files under a specific folder to my root.

Example:

On my domain I have www.domain.com/subfolder (with a lot of pages in it).

I want users to go to my root everytime they go to .../subfolder/file.html (no matter what file the try to access)

Any suggestions? I know it's easy for some of you, but I have tried for days now.

9:23 pm on July 13, 2005 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Apr 9, 2005
posts:1509
votes: 0


Hi Solutions,

Could you post an example of what you have tried, so we can not only help you with the rewrite, but also show you where the error may be for future reference?

Please, also post what you mean by not working... do you mean server errors, page not found, or no redirect?

Justin

[edited by: jdMorgan at 1:32 am (utc) on July 14, 2005]
[edit reason] Speling. [/edit]

4:20 am on July 14, 2005 (gmt 0)

Junior Member

10+ Year Member

joined:Dec 14, 2004
posts:41
votes: 0


Hi Justin,

Among plenty other things I tried:

RewriteEngine On

RewriteRule ^http://www.mydomain.com/blog/(.*)$ [mydomain...] [R=301,L]

The above seems to do absolute nothing.

The above .htaccess is uploaded to the blog folder...thats right is it not?

/ Claus

4:45 am on July 14, 2005 (gmt 0)

Senior Member

WebmasterWorld Senior Member jdmorgan is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:Mar 31, 2002
posts:25430
votes: 0


The correct syntax for use in your Web root ('home page') folder would be:

RewriteRule ^blog/(.*)$ http://www.example.com/$1 [R=301,L]

and if you want to put the code into the /blog/.htaccess file, then it would be:

RewriteRule ^(.*)$ http://www.example.com/$1 [R=301,L]

You might want to take a look at the URL Rewriting Guide cited in our Forum Charter [webmasterworld.com].

Jim

1:02 pm on July 14, 2005 (gmt 0)

Junior Member

10+ Year Member

joined:Dec 14, 2004
posts:41
votes: 0


Thanks Jim,

I'll try it ater today when I get off work.

Thanks again:-D

4:52 pm on July 14, 2005 (gmt 0)

Junior Member

10+ Year Member

joined:Dec 14, 2004
posts:41
votes: 0


I'll be darned...

That did not work either.

Also I managed to screw up my allready working "no www" redirect to "www".

That was the most important thing I got fixed.

I am positive that my old .htaccess file looked like this:

RewriteEngine On
RewriteCond %{HTTP_HOST} ^domain.com
RewriteRule (.*) [domain.com...] [R=301,L]

Doesn't that look allrigt to you guys? Anyay it does not seem to work anymore for some reason.

2:58 am on July 16, 2005 (gmt 0)

Senior Member

WebmasterWorld Senior Member jdmorgan is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:Mar 31, 2002
posts:25430
votes: 0


1) You may need
Options +FollowSymLinks

ahead of your code.

2) Make sure you flush your browser cache (Temporary Internet Files) before testing each change.

3) Check your server error log if you get an error reported in the browser.

Jim

4:45 am on July 20, 2005 (gmt 0)

Junior Member

10+ Year Member

joined:Dec 14, 2004
posts:41
votes: 0


Thanks,

Forgot to refresh the cache...:-D

 

Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members