Jump to content

.htaccess Mod_rewrite


Guest Neosoph

Recommended Posts

Posted

We don't support this, don't submit a ticket. ;)

Unfortunately I'm not all that familiar with htaccess syntax. But is there any specific reason why you want to do this? Doesn't seem to accomplish anything if you ask me, except for a ton of redirection without any real benefit.

  • 4 weeks later...
Posted

I have another (but similar problem).

Example:

Few months ago I created sitemap, file was named sitemap.xml
After 2-3 weeks I deleted it, and my new sitemap was named sitemap_second.xml

But sometimes in error log I see this:

[Tue Aug 28 02:26:18 2007] [error] [client 66.249.72.230] File does not exist: /host/mydomain.com/root/sitemap.xml



IP 66.249.72.230 refers to Google bot. Google bot of course found my new sitemap_second.xml, but sometimes it's looking for old sitemap (the same Yahoo).

I need all bots redirect from sitemap.xml to sitemap_second.xml. How?

Posted

What syntax? I am pretty unfamiliar with mod_rewrite, I need fix this because Google and Yahoo bots are stupid and there is lot of bad entries in my server error log :D

Posted

Searched Google - first link gives the answers for both questions.

To redirect example.com/index.php to example.com/

RewriteEngine on # index.php to / RewriteCond %{THE_REQUEST} ^[A-Z]{3, 9}\ /.*index\.php\ HTTP/ RewriteRule ^(.*)index\.php$ /$1 [R=301,L]

Options +FollowSymLinks





To redirect old page to new page

Redirect 301 /sitemap.xml http://www.example.com/sitemap_second.xml



(Remember to change www.example.com in the above example, and remember to test the rule afterwards!)


http://www.webweaver.nu/html-tips/web-redirection.shtml

Posted

Searched Google - first link gives the answers for both questions.



To redirect old page to new page



Redirect 301 /sitemap.xml http://www.example.com/sitemap_second.xml

(Remember to change www.example.com in the above example, and remember to test the rule afterwards!) http://www.webweaver.nu/html-tips/web-redirection.shtml

Thanks Brandon, it looks like so easy :D Before I tried

RewriteRule   ^sitemap.xml$  sitemap_second.xml [L,R=permanent]


but I got 500

Now it's solved.

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...