rewrite folder / hide user access problems

Discuss practical ways rearrange URLs using mod_rewrite.

rewrite folder / hide user access problems

Postby jhaek_19 » Sat Oct 03, 2009 4:30 pm

Hi

I found this code of yours in the forum:

RewriteEngine On
RewriteRule !^joomla(/.*)?$ /joomla%{REQUEST_URI} [QSA,L]
RewriteCond %{ENV:REDIRECT_STATUS} ^$
RewriteRule ^joomla(/(.*))?$ /$2 [R=301,L]

result is:

when www.domain.com is entered it redirects to the folder:
www.domain.com/newfolder but hides the folder name "newfolder"
and shows only www.domain.com


It was nice, working perfectly but when on my website access, when my users try to login in my login form, it does nothing...it does not log in or send any message at all. Is this problem due to the rewrite of the folder?

Please reply!

Thanks!

jhaek
jhaek_19
 
Posts: 4
Joined: Fri Oct 02, 2009 6:41 pm

Postby richardk » Sat Oct 03, 2009 4:45 pm

It was nice, working perfectly but when on my website access, when my users try to login in my login form, it does nothing...it does not log in or send any message at all. Is this problem due to the rewrite of the folder?

Do you get a blank page? Does the form submit at all?
What is the <form>'s action=""?
Do other forms on the website work?
richardk
 
Posts: 8800
Joined: Wed Dec 21, 2005 7:50 am

Postby jhaek_19 » Sat Oct 03, 2009 4:56 pm

Well, if I remove the .htaccess and browse the www.mydomian.com/testfolder everything is fine...

here's the form's action:
<form action="/newfolder/index.php?option=com_content&amp;view=article&amp;id=1&amp;Itemid=1" method="post" name="login" id="form-login" >
...
<input type="hidden" name="option" value="com_user" />
<input type="hidden" name="task" value="login" />
<input type="hidden" name="return" value="L3RzcG9ydHovaW5kZXgucGhwP29wdGlvbj1jb21fY29udGVudCZ2aWV3PWFydGljbGUmaWQ9MSZJdGVtaWQ9MQ==" />
<input type="hidden" name="43c9f93fbf4498044258703962e5eb1e" value="1" />
</form>

im using joomla...

richardk wrote:
It was nice, working perfectly but when on my website access, when my users try to login in my login form, it does nothing...it does not log in or send any message at all. Is this problem due to the rewrite of the folder?

Do you get a blank page? Does the form submit at all?
What is the <form>'s action=""?
Do other forms on the website work?
jhaek_19
 
Posts: 4
Joined: Fri Oct 02, 2009 6:41 pm

Postby richardk » Sat Oct 03, 2009 5:51 pm

/newfolder is the directory you are trying to hide, correct? Then the <form> action="" should not include it
Code: Select all
action="/index.php?option=com_content&amp;view=article&amp;id=1&amp;Itemid=1"

The problem is that it is a POST form and the redirect loses the POST data. You should probably be able to change a base URL setting or similar in Joomla to fix this. You should make sure that non of your links include /newfolder as that would mean a redirect for every request (click of that link) which is inefficient.
richardk
 
Posts: 8800
Joined: Wed Dec 21, 2005 7:50 am

Postby jhaek_19 » Sat Oct 03, 2009 6:01 pm

ok thanks! will work on it
jhaek_19
 
Posts: 4
Joined: Fri Oct 02, 2009 6:41 pm


Return to Friendly URLs with Mod_Rewrite

Who is online

Users browsing this forum: Google [Bot] and 22 guests

cron