Is there a way for me to make a sort of universal URL like this:
/News?Today
/News?Archive
/News?703
/News?654
/News?308 (and so on)
Instead of:
/News?which=Today
/News?which=Archive
/News?which=703
/News?which=654
/News?which=308 (and so on)
A friend gave me a following suggestion, although he is not really sure this is the correct htaccess command:
RewriteRule /News?Today /News.php?which=Today
You can use this rule in your site root .htaccess:
DirectoryIndex Ena.php
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.+)$ Ena.php?open=$1 [L,QSA]
RewriteCond %{QUERY_STRING} ^([^=]+)$
RewriteRule ^/?$ Ena.php?open=%1 [L]
Not tested:
RewriteRule ^/News?(.*)$ /News.php?which=$1 [L,QSA]
The whole thing:
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^/News?(.*)$ /News.php?which=$1 [L,QSA]
</IfModule>