0

If 'localhost/a/something' is the url, the .htaccess rewrites it to 'localhost/a/1.php?food=something'

If I type in 'localhost/a/something something' it gives me a 404 error.

My current .htaccess:

RewriteEngine on RewriteBase /a/ RewriteRule ^([A-z]+)$ 1.php?food=$1 [L] 

How can I 'localhost/a/something something' to 'localhost/a/1.php?food=something+something'?

2 Answers 2

1

Please have a look at:

How to redirect %20 or White space automatically to + or - with htaccess?

This seems to do what you are trying to do...

Sign up to request clarification or add additional context in comments.

Comments

0

Try this rule in your .htaccess:

RewriteRule ^article/with\ 1.php$ /food/1.php [R=301,L] 

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.