1

I want url like www.abc.com/pagename but when I wrote RewriteRule ^(.*)$ page-detail.php?url=$1 but it will show www.abc.com/pagename not www.abc.com/index.php or www.abc.com

I want to run both pages www.abc.com/index.php and www.abc.com/pagename. How I can ?

3
Contributors
2
Replies
21
Views
3 Years
Discussion Span
Last Post by sikander123
0

Hi,

Never tested, but it is more likely something like this will work for you.

RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}\.php -f
RewriteRule ^([^/]+)/$ $1.php 

or can be something like this.

RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}\.php -f
RewriteRule ^([^/]+)/$ $1.php 


RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !(\.[a-zA-Z0-9]{1,5}|/)$
RewriteRule (.*)$ /$1/ [R=301,L]

the above should be able to handle

www.abc.com/index.php
www.abc.com/index/

0
RewriteEngine on



RewriteCond $1 !^(index\.php|get_captcha\.php|info\.php|blog|pagination|video|audio|uploads|images|flowplayere|mysqladmin|admindata|theme|fonts|css|cv|csv|swf|ckeditor|ckfinder|images|uploads|js|fancybox|phpreports-master|robots\.txt|favicon\.ico)



RewriteRule ^(.*)$ /root folder here/index.php/$1 [L]


//simply use your root folder  
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.