I need some assistance, im trying to rewrite my urls using .htaccess but nothings happening!
1) How do i check to see if mod_rewrite is installed?
2) Is there anything wrong with this, i have a news.php page and you can browse by news.php?page=2
RewriteEngine on
RewriteRule ^news/$ news.php
RewriteRule ^news/([0-9])$ news/$1/ [R]
RewriteRule ^news/([0-9])/$ news.php?page=$1
Help please!
Comments
Since /news/ doesn't actually exist, it won't find the files it's looking for.
The way most people get around this is to use the full path to the files rather than relative paths like images/image.png.
I got around this by making it appear as if there was an actual file rather than a directory.
I have news.html rather than /news/ which works great, but it does mean you end up with URL's like news_1234.html when using 2 variables in a query string.
This might work: Basically, it should make news.php?page=1 into news_1.html and so on.
Remember to update your links or you'll still end up on news.php?page=1 and not the rewrite URL.
You can try asking your host if they support mod_rewrite through their support forums or whatever they have.
Most decent hosts will have the mod_rewrite Apache module available since some top end sites use it (devdreams uses it on the main site).
Current project: CMS Object.
Most recent change: Theme support is up and running... So long as I use my theme resource loaders instead of that in the Rails plug-in.
Release date: NEVER!!!
But i cant get the example above working!