Page 1 of 1
rewrite from subfolder to root url [almost solved]
Posted: Wed Apr 02, 2008 10:44 pm
by SimonSchaufi
hello !
I have cmsms installed in a folder which is called cmsmadesimple. now i want the visitor to type the url:
http://example.com/ but with a htaccess file the user should access
http://example.com/cmsmadesimple. This new url should not be visible, he shall just see the base url.
i have read this:
http://httpd.apache.org/docs/1.3/mod/mod_rewrite.html
but i have no idea how to solve that.
if my explanation was to complicated:
should type:
http://localhost/
should access:
http://localhost/cmsmadesimple
should not be redirected but see only:
http://localhost/
Re: rewrite from subfolder to root url [almost solved]
Posted: Thu Apr 03, 2008 7:37 am
by SimonSchaufi
Code: Select all
RewriteEngine On
RewriteCond %{REQUEST_URI} !/cmsmadesimple/
RewriteRule (.*) /cmsmadesimple/$1 [L]
but now when i try:
http://www.example.com/test it accesses the folder /cmsmadesimple/test but i want it to access
http://www.example.com/test
simon
Re: rewrite from subfolder to root url [almost solved]
Posted: Thu Apr 03, 2008 7:48 am
by Wiedmann
Just a question:
Is it not easie,r to simply copy your cms into the document root?
Re: rewrite from subfolder to root url [almost solved]
Posted: Thu Apr 03, 2008 7:53 am
by SimonSchaufi
I have 2 different cms installed and i dont want both in the root, thats why i need it.
Re: rewrite from subfolder to root url [almost solved]
Posted: Thu Apr 03, 2008 6:20 pm
by Pierre M.
And how should the other site in the root be accessed ?
How should the webserver know to which CMSms install it should forward internaly a request ?
Pierre M.
Re: rewrite from subfolder to root url [almost solved]
Posted: Thu Apr 03, 2008 7:15 pm
by SimonSchaufi
i want CMS Mades Simple to be accessed like
http://localhost/cmsmadesimple/ and Joomla with the root URL
Re: rewrite from subfolder to root url [almost solved]
Posted: Thu Apr 03, 2008 7:25 pm
by Pierre M.
I don't know Joomla but I think if you install it in the root it will be accessible like
http://localhost/
If you make your CMSms install dir be /cmsmadesimple then it will be accessible like
http://localhost/cmsmadesimple/
Just make sure some mod_rewrite Joomla doesn't take /cmsmadesimple prefixed URLs.
Pierre M.
Re: rewrite from subfolder to root url [almost solved]
Posted: Thu Apr 03, 2008 8:31 pm
by SimonSchaufi
Yes, i know that already. I just thought that it is possible but if there is nobody here in this forum that can help me, no problem.
Re: rewrite from subfolder to root url [almost solved]
Posted: Fri Apr 04, 2008 3:05 pm
by Pierre M.
SimonSchaufi wrote:
Yes, i know that already.
If I say what you already know I think I haven't undersood what your question is.
Pierre M.
Re: rewrite from subfolder to root url [almost solved]
Posted: Fri Apr 04, 2008 3:21 pm
by SimonSchaufi
ok, i think it it better to move the homepage to the root and forget about all mod_rewrites
as i searched in google i think it is not possible to access a subfolder but display in the addressbar the root url.
usually u use mod_rewrite to do the following:
http://localhost/index.php?page=alias¶m=value ->
http://localhost/alias/param/ or something like that.
so my idea was to do exactly the same like if i call
http://localhost/index.php?page=alias¶m=value
i will access
http://localhost/cmsmadesimple/index.php?page=alias¶m=value
in the background but still see
http://localhost/index.php?page=alias¶m=value
in my addressbar