homepage Welcome to WebmasterWorld Guest from 54.161.214.221
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Home / Forums Index / Code, Content, and Presentation / Apache Web Server
Forum Library, Charter, Moderators: Ocean10000 & incrediBILL & phranque

Apache Web Server Forum

    
,htaccess setup
curly_clare




msg:1513583
 3:26 pm on Feb 5, 2004 (gmt 0)

Hi,

I'm having a nightmare here! I've created a .htaccess file as below due to the fact that all the file names on our site changed from .htm to .html:

---------------------
redirect 301 /filename.htm [mydomain.co.uk...]
----------------------

When I upload this file it works fine, no problem!

I need to do this for every page so I assumed that i could write a line of code for every page in a single .htacccess file. However when i uploaded this file the site was returning a 500 Internal error code.

Is it necessary to upload a seperate .htaccess file
for each redirect? If so, do you call them all .htaccess or use unique filenames?

Any help and advice would be greatly appreciated.

Many thanks.

 

davidpbrown




msg:1513584
 3:46 pm on Feb 5, 2004 (gmt 0)

If it is every file maybe try..
RedirectMatch permanent ^(.*)\.htm $1.html

Each .htaccess file acts on that directory and its subdirectories.. I would expect you need only one htaccess file.

jdMorgan




msg:1513585
 4:36 am on Feb 6, 2004 (gmt 0)

curly_clare,

It will only necessary to have one line of code in one .htaccess file to redirect all of your pages.

You need only add "http://www.example.com" to the new URL in the above code, as shown in the example given in the RedirectMatch documentation [httpd.apache.org].

Jim

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / Apache Web Server
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved