PHP Developers Network

A community of PHP developers offering assistance, advice, discussion, and friendship.
 
Loading
It is currently Mon Oct 23, 2017 1:09 am

All times are UTC - 5 hours




Post new topic Reply to topic  [ 4 posts ] 
Author Message
PostPosted: Tue Jan 28, 2014 7:03 pm 
Offline
Forum Contributor

Joined: Wed Nov 05, 2008 1:06 am
Posts: 153
rewrite rule:

Options +FollowSymlinks

RewriteEngine On

RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^search/(.*)$ http://www.domain.com/search/?term=$1
I want all search/my_search to go to search/?term=my_search silently

Thanks


Top
 Profile  
 
PostPosted: Tue Jan 28, 2014 8:17 pm 
Offline
Spammer :|
User avatar

Joined: Wed Oct 15, 2008 2:35 am
Posts: 6573
Location: WA, USA
And the problem is... that it's not silent? But otherwise works?


Top
 Profile  
 
PostPosted: Tue Jan 28, 2014 8:23 pm 
Offline
Moderator
User avatar

Joined: Tue Nov 09, 2010 3:39 pm
Posts: 6391
Location: Montreal, Canada
By matching everything after search/ and redirecting it to a URL containing search/, you have created an infinite loop. I'd have thought matching everything except a question mark (ie. ([^\?]+)) would work, but that still redirects forever. This isn't perfect, but it works.

Code:
RewriteRule ^search/([a-zA-Z0-9\-_\+\s]+)$ search/?term=$1 [L]

_________________
Supported PHP versions No longer supported versions


Top
 Profile  
 
PostPosted: Tue Aug 12, 2014 4:24 am 
Offline
Forum Newbie

Joined: Sun Aug 10, 2014 11:16 pm
Posts: 2
Hay friend
Try it for getting the rewrite rule working
RewriteEngine on
RewriteCond %{HTTP_HOST} ^cp.abc.com$ [OR]
RewriteCond %{HTTP_HOST} ^www.cp.abc.com$
RewriteRule ^/?$ "http\:\/\/cp\.xyz\.com" [R=301,L]

I have also ensured IP and document root path on both subdomains under /var/cpanel/userdata/username/ directory and it is correct.

Thank you


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB® Forum Software © phpBB Group