Using rewrite rule while passing redirection address

Discuss practical ways rearrange URLs using mod_rewrite.

Using rewrite rule while passing redirection address

Postby vahid4134 » Tue Jun 03, 2008 4:49 am

Hi,

I'm using mod_rewrite to enable clean URLs for my script. I came across a problem and that is when using clean URLs to redirect the user to another page. Suppose that the user clicks on "blogs" section in my site. Now as the user needs to be logged in, he will be redirected to a URL like this :
Code: Select all
http://domain.com/page/blogs/login/ret_link/http:%2F%2Fdomain.com%2Fuser%2Fmy

This means the user needs to login and after he logs in, he will be redirected to http://domain.com/user/my
My .htaccess is :
Code: Select all
  RewriteCond  %{REQUEST_FILENAME} !^/$
  RewriteCond  %{REQUEST_FILENAME} !^/(admin)(/.*)?
  RewriteCond  %{REQUEST_FILENAME} !\.(php|ico|png|jpg|gif|css|js|html?)(\W.*)?
  RewriteRule ^(.*)$ /index.php?qqqmod_rewrite=$1 [L,QSA]


But I get a 404 "not found" error :(
What should I do now ?
vahid4134
 
Posts: 1
Joined: Tue Jun 03, 2008 4:38 am

Postby richardk » Tue Jun 03, 2008 2:07 pm

If you replace %2F with / does it work?
Do you have any other URLs?
richardk
 
Posts: 8800
Joined: Wed Dec 21, 2005 7:50 am


Return to Friendly URLs with Mod_Rewrite

Who is online

Users browsing this forum: No registered users and 113 guests

cron