Remove .php

New to mod_rewrite? This is a good place to start.

Not working

Postby puneetbrar » Fri May 15, 2009 9:23 pm

Hi there

thanks for all the help

This rule is not working

Options +FollowSymLinks -MultiViews

RewriteEngine On

RewriteCond %{ENV:REDIRECT_STATUS} ^$
RewriteCond %{QUERY_STRING} ^(.*&)?id=7(&.*)?$ [NC]
RewriteRule ^story\.php$ /story/37? [R=301,L]

RewriteRule ^story/37/?$ story.php?id=7 [QSA,L]


But this thing is workimg

Options +FollowSymLinks -MultiViews

RewriteEngine On

RewriteCond %{ENV:REDIRECT_STATUS} ^$
RewriteCond %{QUERY_STRING} ^id=([0-9]*)$
RewriteRule ^story\.php$ /story/37? [R=301,L]
RewriteRule ^story/37/?$ story.php?id=7 [QSA,L]

but still the problem is that css is not working with the same

and url is ok

I a m getting the same page that is on story.php?id=7

http://www.okidda.com/story/37

please help me with this
puneetbrar
 
Posts: 8
Joined: Mon May 11, 2009 7:41 am

Postby richardk » Sat May 16, 2009 9:09 am

but still the problem is that css is not working with the same

FAQ: Relative paths to images, JavaScript, CSS and other external/linked files are broken.
richardk
 
Posts: 8800
Joined: Wed Dec 21, 2005 7:50 am

about us

Postby puneetbrar » Sat May 16, 2009 8:30 pm

puneetbrar
 
Posts: 8
Joined: Mon May 11, 2009 7:41 am

Postby richardk » Sun May 17, 2009 9:27 am

Try adding
Code: Select all
RewriteCond %{ENV:REDIRECT_STATUS} ^$
RewriteCond %{SCRIPT_FILENAME} -f
RewriteRule ^(.+)\.php$ /$1/ [R=301,L]

RewriteCond %{DOCUMENT_ROOT}/$1.php -f
RewriteRule ^(.*[^/])/?$ /$1.php [QSA,L]
richardk
 
Posts: 8800
Joined: Wed Dec 21, 2005 7:50 am

mod_rewrite for clean url's

Postby pushpinderbagga » Fri May 22, 2009 9:46 pm

hello richardk I think puneet is a bit confused and totally relying on your knowledge and not experimenting on his own... neways...

to convert about.php to about/

we could use

RewriteRule ^about/?$ about.php [NC]

with this... both about.php and about/ will work... cheeers !
pushpinderbagga
 
Posts: 36
Joined: Fri May 22, 2009 9:43 pm

Previous

Return to Beginner's Corner

Who is online

Users browsing this forum: No registered users and 94 guests

cron