Forums / Developer / URL rewrite www.domain.com/index.php/domain.com
Jeroen van Duffelen
Tuesday 13 January 2009 9:45:35 am
I am a total nobody when it comes to .htaccess and URL rewrites so I was wondering if it is possible to rewrite <b>site-x.domain.com</b> to <b>site-x.domain.com/index.php/site-x</b> with Exponential. I have been trying around with the htaccess file but i cant seem to figure out how it works...
Any help is welcome!!!! Thanks
Christophe Condomines
Tuesday 13 January 2009 11:45:49 am
Something like this should work (not tested):
RewriteEngine on RewriteCond %{HTTP_HOST} [^.]+\.domain\.com$ RewriteRule ^(.+) %{HTTP_HOST}$1 [C]RewriteRule ^([^.]+)\.domain\.com(.*) /index.php/$1$2
This may not work in a .htaccess file, may be it must be in an Apache conf file. Not sure...
Microblau SL http://www.microblau.net
Wednesday 18 February 2009 3:32:27 pm
Christophe thx for your quick reply! Because of other priorities I did not have the time to dive into this one any earlier. But I managed to get rid of the difficult urls like:
site-x.domain.com/index.php/site-x
I'm able to use site-x.com/index.php/site-x now, because I got the permissions to create URL aliases on the server. This way we do not have to do the difficult rewrites as you suggested before. I havent tested them but I'm wondering if you can help me out with this one?
The site visitor now has to type in the complete URL to visit the website. For a real life example see:
http://www.mybiz.cc/index.php/mybiz.cchttp://www.beoordeelzorg.nl/index.php/beoordeelzorg.nl
Now offcourse I dont want the visitor to type in the full address like the ones above.The best solution would be:
http://www.mybiz.cc/ ...http://www.beoordeelzorg.nl/ ...
I tried to play with your example but couldnt get any result. Btw, I'm using the standard .htaccess file which comes with the Exponential package.
Jorge estévez
Thursday 19 February 2009 1:36:32 am
Hello,
Can you please tell me how to make the site-x.domain.com on a site in order to have al registered users have something like user-name.site-x.com
Can you type the .htaccess or any configuration that will enable such an URL. I am too lost when It comes to .htaccess config to solve such an issue.
thanks
Diseño Web Cuba Web Design Cuba www.elfosdesign.com
Thursday 19 February 2009 2:01:21 am
Hi Jorge,
You could do that exactly like with my Exponential solution... if I know how to get the htaccess rewrite rules going! Jorge, do you already have Exponential set up to be able to do:
domain.com/index.php/username