0

I have never edited the .htaccess file before so sorry for my awful attempt

RewriteEngine On
RewriteCond %{REQUEST_URI}  ^/index\.php$
RewriteCond %{QUERY_STRING} ^id=([0-9]*)$
RewriteRule ^(.*)$ http://example.site/index/%1 [R=302,L]

I am tryting to rewrite http://ex.com/shop/?s=sa to look like http://ex.com/shop/sa

4
  • Can you explain a little more about what you are trying to accomplish? Commented May 7, 2017 at 18:49
  • Hi, i have updated Commented May 7, 2017 at 18:51
  • RewriteCond %{THE_REQUEST} "\s/shop/\?s=(\w*)\s" -> RewriteRule ^ "http://example.site/shop/%1?" [R=302,L] Commented May 7, 2017 at 19:33
  • Hi deaooshka I seem to get a 500 error with this Commented May 7, 2017 at 20:00

1 Answer 1

1

I am assuming you are using rewriterules in shop directory and index.php is handling the data then try with below.

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.+?)$ index.php?s=$1 [L]
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.