Mobile app version of vmapp.org
Login or Join
Margaret670

: Rewrite rule for friendly URLs to index.php is not working from htaccess Trying to get SEO Friendly URLs to work for my website using the following htaccess: RewriteBase / RewriteCond %{REQUEST_FILENAME}

@Margaret670

Posted in: #Htaccess #ModRewrite #Seo #UrlRewriting

Trying to get SEO Friendly URLs to work for my website using the following htaccess:

RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-l
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^explore/(.*)$ index.php?page=explore&type=
RewriteRule ^(.*)$ index.php?page=


E.g. it should load /index.php?page=test for /test/ and /index.php?page=explore&type=1 for /explore/1.

However it's not working, does anyone know how I could get this to work?

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Margaret670

1 Comments

Sorted by latest first Latest Oldest Best

 

@Sent6035632

You have RewriteEngine On missing
RewriteCond are only applicable to next immediate RewriteRule


Try this code:

RewriteEngine On

RewriteBase /

RewriteCond %{REQUEST_FILENAME} !-l
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^explore/(.*)$ index.php?page=explore&type= [L]

RewriteCond %{REQUEST_FILENAME} !-l
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?page= [L]

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme