skip to Main Content

A very common problem, but couldn’t fix the issue.

I want

 http://website.de/page.php?module=helios

into

 http://website.de/page/helios

I have tried lots of .htaccess code like this one, but still page sends to 404.

RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ page.php?module=$1

Please provide some suggestions.

3

Answers


  1. Try this rule in your site root .htaccess:

    Options -MultiViews
    RewriteEngine on
    
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^page/([^/]+)/?$ page.php?module=$1 [L,NC,QSA]
    
    Login or Signup to reply.
  2. Try…

    RewriteRule ^page/([^/]*)/$ /page.php?module=$1 [L]
    
    Login or Signup to reply.
  3. Use this use your base path

    RewriteEngine on
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^page/(.*)$ page.php?module=$1
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search