Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > ISPConfig 3 > Installation/Configuration

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #1  
Old 2nd February 2011, 09:51
manarak manarak is offline
Senior Member
 
Join Date: Apr 2009
Posts: 263
Thanks: 32
Thanked 6 Times in 5 Posts
Default Getting mod rewrite to work - please help

Hi all, I have the following .htaccess file:

Code:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTP_HOST} !^www\.mydomain.com
RewriteCond %{HTTP_HOST} ([^.]+)\.mydomain.com
RewriteRule ^(.*)$ /var/www/clients/client2/web7/web/_DEV/virtual_subdom.php?user=%1
</IfModule>
I dropped it into /web, and now I expect every URL in the format www.mydomain.com/xyz to be redirected to

/var/www/clients/client2/web7/web/_DEV/virtual_subdom.php?user=xyz

(as far as no xyz directory exists in /web)

but it doesn't work, I get the ISPC3 404 page.


then I tried to modify the apache directives in the website options in ISPC3.

These are my current settings:
Code:
<LocationMatch "/">
    SecRuleRemoveById 970009,950006,970003
</LocationMatch>
<LocationMatch "/index.php">
    SecRuleRemoveById 950911,950001,950001,950013
</LocationMatch>
<Directory /var/www/clients/client2/web7>
Options All
AllowOverride All
Order allow,deny
Allow from all
php_admin_value safe_mode 0
php_admin_value register_globals 0
php_admin_value open_basedir "/var/www/clients/client2/web7"
</Directory>
I added the following 4 lines to try to get mod rewrite to work, but it didn't help:
Options All
AllowOverride All
Order allow,deny
Allow from all

Can someone please help me?
I am totally lost.
Reply With Quote
Sponsored Links
  #2  
Old 3rd February 2011, 12:24
till till is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lneburg, Germany
Posts: 37,015
Thanks: 840
Thanked 5,651 Times in 4,461 Posts
Default

1) Where is the .htaccess file? is it var/www/clients/client2/web7/web/.htaccess ?

2) The rwrite conditions are wrong, you missed to mask the dots of the tld. It has to be:

RewriteCond %{HTTP_HOST} !^www\.mydomain\.com
RewriteCond %{HTTP_HOST} ([^.]+)\.mydomain\.com

3) The rewrite path seems to be wrong, try:

RewriteRule ^(.*)$ _DEV/virtual_subdom.php?user=%1

or

RewriteRule ^(.*)$ /_DEV/virtual_subdom.php?user=%1

4) Remove the lines:

Options All
AllowOverride All
Order allow,deny
Allow from all

from the apache directives field.
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
The Following User Says Thank You to till For This Useful Post:
manarak (3rd February 2011)
  #3  
Old 3rd February 2011, 14:05
manarak manarak is offline
Senior Member
 
Join Date: Apr 2009
Posts: 263
Thanks: 32
Thanked 6 Times in 5 Posts
 
Default

Thank you Till, it is working now!
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
enable mod rewrite for the ISPconfig apache web server blocker General 3 18th April 2009 17:14
rewrite url not work apache2+mod_rewrite mohamedtah Installation/Configuration 1 31st January 2009 14:00
Lighttpd Mod Rewrite Problem Whrt Server Operation 1 5th September 2008 13:40
mod rewrite htaccess tera7 Server Operation 4 13th September 2007 02:09
how to enable Mod Rewrite AngelDrago Installation/Configuration 9 11th August 2007 00:20


All times are GMT +2. The time now is 14:44.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.