Microsoft
Software
Hardware
Network
Question : Please check my mod_rewrite
I just want to make sure this is correct:
RewriteEngine on
RewriteCond %{REQUEST_URI} !/$
RewriteCond %{REQUEST_URI} !\.
RewriteRule ^(.*) %{REQUEST_URI}/ [R=301,L]
RewriteRule index/(.*)/(.*)/$ /index.php?$1=$2
RewriteRule cities/(.*)/(.*)/$ /cities.php?$1=$2
RewriteRule towns/(.*)/(.*)/$ /towns.php?$1=$2
RewriteRule profile/(.*)/(.*)/$ /profile.php?$1=$2
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^/]+)/([^/]+)/?$ /directory.php?category=$1
&subcat=$2
[L,QSA]
Answer : Please check my mod_rewrite
Allow directory links to work with the trailing slash and without:
#no trailing slash
RewriteCond %{REQUEST_URI} !/$
#and it's not path to valid file(so either dir or nonexistent), checking for dot only is not the best option here
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule .* %{REQUEST_URI}/ [R=301,L]
pretty normal rewrites look fine, hence You may want to add the [QSA] option - You already know what it means.
Cut down the huge url of the directory:
Oh, i know the code ;) So I guess I have to say it's OK. One little note.
It allows the ending slash to be missing "^([^/]+)/([^/]+)/?$" - the question mark says, the slash is optional - but it's OK i guess.
Random Solutions
How to alter 'Show time As' default headings?
Windows Command line popup alerts
SSRS FormatDateTime
Outlook no longer remembers Active Directory credentials
Disabled Syskey by mistake
public store problem - database not up to date
Services Crashing Multiple Times Per Day: wuauserv, bits, browser, trkwks, dmserver, seclogon, lanmanserver, audiosrv, sharedaccess, wzcsvc, and lanmanworkstation
Unerase files on a CD-RW ?
How to cat 2 variables variables
Company trying to sabotage our SEO