Hi All,
Please excuse my ignorance. It's my first attempt with mod_rewrite and I'm finding the learning curve somewhat steep.
I've created a PHP script called urllist.php which contains, unsurprisingly, a list of URLs for Yahoo to index. This needs to be named urllist.txt on the server, so I want to use mod_rewrite to change the name.
This is my original .htaccess file (I am using Network Solutions, should that make any difference).
Custom error pages
ErrorDocument 404 http://www.mysite.co.uk/error404.php
301 redirects to prevent non-www page views
Options +FollowSymlinks
RewriteEngine on
rewritecond %{http_host} mysite.co.uk [nc]
rewriterule (.*)$ http://www.mysite.co.uk/$1 [r=301,nc]
index.php to /
RewriteEngine on
RewriteCond %{THE_REQUEST} [A-Z]{3,9}\ /.index.php\ HTTP/
RewriteRule (.)index.php$ /$1 [R=301,L]
All of the above works. However, when I add the following rule to the bottom of the file it does not rewrite the name of urllist.php as intended.
RewriteEngine on
RewriteRule urllist.txt$ /urllist.php [L]
Please could someone kindly let me know where I am going wrong? I presume that this is fairly simple to do, when you know how?!
Cheers,
Matt