September 2012
M T W T F S S
 12
3456789
10111213141516
17181920212223
24252627282930

Categories

September 2012
M T W T F S S
 12
3456789
10111213141516
17181920212223
24252627282930

Apache force use https

Force Apache to use https :

RequestHeader set X_FORWARDED_PROTO ‘https’

Apache Rewrite Cheat Sheet

Regular Expression Syntax ^ Start of string $ End of string . Any single character (a|b) a or b (…) Group section [abc] Item in range (a or b or c) [^abc] Not in range (not a or b or c) a? Zero or one of a a* Zero or more of a a+ One […]

Free Softwares

Office OpenOffice – office suite PC Suite 602 – office suite AbiWord – text editor Atlantis Nova – text editor Microsoft PowerPoint Viewer – power point files viewer Adobe Reader – pdf reader Foxit PDF Reader – pdf reader PDFCreator – create pdf documents Doc Convertor – document convertor Convert – unit convertor Converber […]

Apache rewrite rules

<Directory /var/www/vhosts/rmohan.com/httpdocs> RewriteEngine on rewriterule ^(.+).htm$ /$1.php [r=301,nc] RewriteRule ^community community.php [nc] ErrorDocument 404 /index.php </Directory>

Rewrite only if a folder exists

RewriteCondthat checks if the requested file exists:

RewriteCond %{REQUEST_FILENAME} !-f

Great, but that’s not what I was looking for. Instead I needed to Rewrite only if a specific folder existed. The solution turns out to be this:

RewriteCond %{DOCUMENT_ROOT}/path/within/your/project/ -d

You need DOCUMENT_ROOT as the RewriteCond -d checks for the full path

 

<IfModule mod_rewrite.c>

[…]