Redirect main domain to subfolder with question mark

I want to redirect my main domain to this url which is under the main domain http://cupofertas.com/?s=&dir-search=no&post_type=ait-dir-item

My problem is when I try to access any other page with a question mark on the url like /?p=23 I get redirected again.

Read More

Here is my .htaccess file

RewriteEngine on
RewriteCond %{HTTP_HOST} ^(www.)?cupofertas.com$ [NC]
RewriteCond %{REQUEST_URI} !^/?s=&dir-search=no&post_type=ait-dir-item
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /?s=&dir-search=no&post_type=ait-dir-item$1
RewriteCond %{HTTP_HOST} ^(www.)?cupofertas.com$ [NC]
RewriteRule ^(/)?$ /?s=&dir-search=no&post_type=ait-dir-item [L]

Related posts

Leave a Reply

1 comment

  1. Delete your first rule and keep only this rule:

    RewriteCond %{HTTP_HOST} ^(www.)?cupofertas.com$ [NC]
    RewriteRule ^/?$ /?s=&dir-search=no&post_type=ait-dir-item [L,QSA]