Blu3
Blu3

Reputation: 143

Apache mod rewrite rule not working

I am trying to make my links seo friendly, my current links are like this:

site.dev/al/?page=about

and I am trying to change it into this:

site.dev/al/about

Below you can see what I have been trying in my

.htaccess

so far:

<ifModule mod_rewrite.c>
RewriteEngine on
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ ?page=$1 [L,NS]
RewriteRule ^([^/]*)$ ?page=$1 [L]
</ifModule>

This is my apache log message:

[Wed Apr 05 20:35:44 2017] [error] [client 127.0.0.1] Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace.

Upvotes: 1

Views: 48

Answers (1)

anubhava
anubhava

Reputation: 786289

Have this rule in <DocumentRoot>/al/.htaccess:

RewriteEngine on
RewriteBase /al/

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule .+ ?page=$0 [L,QSA]

Upvotes: 1

Related Questions