0

I have a question.

I have htacess file in my php page :

RewriteEngine on
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^/]+)$ index.php?page=$1 [L]

And technically it works, for request like :

page.com/news

, but i need to add 2 segments in url, similar to the example above

page.com/type&style=something

How to get this to correct form, like :

page.com/type/something

And does it change something in SEO, i mean, the page with /type/something will get higher stats in search engines than /type&name=something?

Thanks!

4
  • So you current rule is working and forwards to /index.php?page=xxx. But i don't understand something. Where should /type/something forward to ? You're talking about /type&style=something but what is it ? Existing rule ? Commented Sep 8, 2014 at 10:22
  • The /type&style=something need to be /something/ or /type/something/ Commented Sep 8, 2014 at 10:51
  • Answer can be found here. Commented Sep 8, 2014 at 11:02
  • Ok but where is forwarded /type/something ? To index.php ? Commented Sep 8, 2014 at 11:41

1 Answer 1

0

For a solution with apache (see Apache mod_rewrite path name as query parameters?).

Another answer to the same question can be found here. There it is suggested to do it with PHP and not with rewriting the URL.

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.