0

I want to access movies.php?m=Bengali Audio but in this format movies/Bengali Audio i write these .htaccess code but its showing File not found, where movies.php?m=Bengali Audiois working fine

RewriteEngine On # Rewrite for movies.php?m=Bengali Audio RewriteRule ^movies/([0-9a-zA-Z_-]+'')$ movies.php?m=$1 [NC,L] 
2
  • 1
    Why do you have '' in your pattern expression? Should be ^movies/([0-9a-z_-]+)$ movies.php?m=$1 [NC,L] (also stripped out A-Z as you have the NC (no-case) flag set. Commented Jan 26, 2016 at 18:06
  • Of course, I omitted the check for whitespace - @anubhava is correct Commented Jan 26, 2016 at 18:46

1 Answer 1

1

You can use this regex pattern to match spaces in movie name:

Options -MultiViews RewriteEngine On # Rewrite for movies.php?m=Bengali Audio RewriteRule ^movies/([^/]+)/?$ movies.php?m=$1 [NC,L,QSA] 
Sign up to request clarification or add additional context in comments.

3 Comments

its working, if i goto movies.php?m=Bengali Audio then all html design is changed, css not working
That is due to your use of relative paths. You can add this just below <head> section of your page's HTML: <base href="/" />

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.