homepage Welcome to WebmasterWorld Guest from 54.237.235.12
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

    
old urls won't redirect shtml
shtml folder redirect
handsun



 
Msg#: 4385224 posted 1:04 pm on Nov 9, 2011 (gmt 0)

I am rebuilding a site that was shtml, there are folders with index pages whose urls look like: [creativeloansnationwide.com...]
they are indexed like that in google webmaster list, the file that displays is actually about/index.shtml,(new page is index.html) but when I try to redirect to the new page
redirect 301 /about/ http://example.com/about/index.html I get a bad response:

http://example.com/about/index.htmlindex.htmlindex.htmlindex.htmlindex.html index.htmlindex.htmlindex.htmlindex.htmlindex.html index.htmlindex.htmlindex.htmlindex.htmlindex.html index.htmlindex.htmlindex.htmlindex.htmlindex.html? sef_rewrite=1&sef_rewrite=1&sef_rewrite=1&sef_rewrite=1 &sef_rewrite=1&sef_rewrite=1&sef_rewrite=1&sef_rewrite=1 &sef_rewrite=1&sef_rewrite=1&sef_rewrite=1&sef_rewrite=1 &sef_rewrite=1&sef_rewrite=1&sef_rewrite=1&sef_rewrite=1 &sef_rewrite=1&sef_rewrite=1&sef_rewrite=1

If I use this next redirect
redirect 301 /about/index.shtml http://example.com/about/index.html
the page redirects, but the links are indexed in google as /about/ (with no page name) and this link below will not redirect with the above htaccess in place
example.com/about/ (this is how they are indexed)
Thank you so much for any help, some pages are shtml and some are not so I am just redirecting about 6 pages like this if I can find out how.

[edited by: jatar_k at 1:18 pm (utc) on Nov 9, 2011]
[edit reason] changed to example.com so code is readable [/edit]

 

jatar_k

WebmasterWorld Administrator jatar_k us a WebmasterWorld Top Contributor of All Time 10+ Year Member



 
Msg#: 4385224 posted 1:16 pm on Nov 9, 2011 (gmt 0)

for changing the index page you should be able to look at the DirectoryIndex, I think that's the one, and make apache look for index.html before index.shtml as the index page in a directory

that way if you have made an index.html it will use that, other wise it will continue to use the old one.

handsun



 
Msg#: 4385224 posted 1:45 pm on Nov 9, 2011 (gmt 0)

I just changed the htaccess to
redirect 301 /about/index.html [creativeloansnationwide.com...]

and got a 500 Server error when I type this in
creativeloansnationwide.com/about/

(that is the url I need to redirect)

handsun



 
Msg#: 4385224 posted 2:32 pm on Nov 9, 2011 (gmt 0)

Ok I got it, I just rename the new pages .shtml and I don't even need redirects, thanks!

g1smd

WebmasterWorld Senior Member g1smd us a WebmasterWorld Top Contributor of All Time 10+ Year Member



 
Msg#: 4385224 posted 7:36 pm on Nov 9, 2011 (gmt 0)

You might be able to use DiretoryIndex. If not, an internal rewrite might be needed.

A redirect is likely not needed, but if it is, use a RewriteRule with the [R=301,L] flags and not Redirect or RedirectMatch.

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