Forum Moderators: phranque
I cant get this rewrite going, i did rewrite for my ecommerce and forum site, but now i only want to rewrite one file and dont work!
I add this at my .htaccess file:
RewriteRule ^forum/sitemap.xml$ /forum/sitemap.php [L]
RewriteRule ^forum/forum-([0-9]+).xml$ /forum/sitemap.php?fid=$1 [L]
The file isnt the root, its at forum directory, i try different tactics, but my im very basic with rewrite, can some have a look, if i get error with the command?
Apreciate your time
Where in your site directories is this .htaccess file located?
My .htaccess file is located in the root:
www.mydomain.com
I have the file that i want to rewrite in the forum directorie:
www.mydomain.com/forum/sitemap.php
Did you includeOptions +FollowSymLinks
RewriteEngine onbefore your mod_rewrite code?
Yes i did
If you get a erver error, check your server access log and your server error log. The information in those files will often identify the problem.
I dont get a server error, only i cant get my php file rewrite to .xml
Your code should work if your pages link to .xml URLs, and corresponding .php files exist.
mod_rewrite acts in the URL-to-file translation phase of the Apache API, and can change the default URL-to-filename mapping. It acts after a URL is requested from your server, but before any content-handlers are invoked to output page content and before any scripts are executed. It does not change the links on your pages.
Hopefully it's not that misunderstanding that is the cause of your trouble.
Jim