Satish Ravipati
Satish Ravipati

Reputation: 1449

how to redirect all URL's to Single page using .htaccess

How can i redirect all the urls to one single page and admin to admin-folder-name ??

example

http://domainname.com/about should point to redirect.php?url=about
http://domainname.com/contact should point to redirect.php?url=contact

But at the same time

http://domainname.com/admin should point to admin folder ??

My current .htaccess is

RewriteEngine on 
RewriteRule (.*) redirect.php?page_url=$1 [QSA,L]

I'm struck with /admin Thanks for the help

Upvotes: 2

Views: 229

Answers (1)

4sha
4sha

Reputation: 326

Try adding a condition that excludes redirecting /admin:

RewriteEngine on 
RewriteCond $1 ^/?admin
RewriteRule (.*) redirect.php?page_url=$1 [QSA,L]

Upvotes: 1

Related Questions