| Subcribe via RSS

mod_rewrite cheat sheet

September 23rd, 2008 | No Comments | Posted in htaccess by dreamluverz



Tags: , , , ,

error using mod_rewrite

January 24th, 2008 | No Comments | Posted in apache, server by dreamluverz

I got an error using mod_rewrite on my local server and it was only solved when I putĀ  Options +FollowSymLinks but on live server using Options +FollowSymLinks gave me an error so I removed it. Well anyway, I came across this post and it has a nice explanation regarding that.



For reference, if anybody else wants to know:
mod_rewrite can be used to simulate a symbolic link. This is why mod_rewrite requires FollowSymLinks to be enabled, because it’s a similar security thing. So if your host doesn’t enable FollowSymLinks, and you try using mod_rewrite, you’ll get the 403 error. Adding Options +FollowSymLinks will override it for your directory, allowing mod_rewrite to work.

But, if you have this problem and you add Options +FollowSymLinks and then get a 500 error instead, then your host is disallowing the use of the Options directive in .htaccess files, and there’s little you can do but complain to them.

source : http://wordpress.org/support/topic/138301#post-630546

Tags: ,

How to make subfolder the main folder for your main domain

December 3rd, 2007 | No Comments | Posted in server by dreamluverz

I’m organizing our server and wanted to make subfolder the main folder for our main domain. Here’s some code to do it from hostmonster.com

# Hostmonster.com
# .htaccess main domain to subfolder redirect
# Copy and paste the following code into the .htaccess file
# in the public_html folder of your hosting account
# make the changes to the file according to the instructions.

# Do not change this line.

RewriteEngine on

# Change yourdomain.com to be your main domain.

RewriteCond %{HTTP_HOST} ^(www.)?yourmaindomain.com$

# Change ’subfolder’ to be the folder you will use for your main domain.

RewriteCond %{REQUEST_URI} !^/subfolder/

# Don’t change this line.

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

# Change ’subfolder’ to be the folder you will use for your main domain.

RewriteRule ^(.*)$ /subfolder/$1

# Change yourdomain.com to be your main domain again.
# Change ’subfolder’ to be the folder you will use for your main domain
# followed by / then the main file for your site, index.php, index.html, etc.

RewriteCond %{HTTP_HOST} ^(www.)?yourmaindomain.com$
RewriteRule ^(/)?$ subfolder/index.php [L]

source: http://helpdesk.hostmonster.com/kb/index.php?x=&mod_id=2&id=308

Tags: , ,