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
How to get this rewrite rule working?
Moderator: General Moderators
Re: How to get this rewrite rule working?
And the problem is... that it's not silent? But otherwise works?
Re: How to get this rewrite rule working?
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: Select all
RewriteRule ^search/([a-zA-Z0-9\-_\+\s]+)$ search/?term=$1 [L]Re: How to get this rewrite rule working?
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
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