Jump to content

looking to ditch the .php extension


Derleek

Recommended Posts

yeah, mod_rewrite is the way to go. if you want a DIFFERENT extension, like .html pages running like PHP pages, that is something different though

 

You can mask php pages as html pages with mod_rewrite too... Though there are other ways of course.

hey - I was wondering if someone can explain to me how mod_rewrite works! I know that you can change the url / name of the a page, but what if a user copies and pastes the link... would it still work?

 

Yes it will still work. it is simply a way to have apache map one url to another. eg;

 

http://yourdomain.com/foo/bar -> http://yourdomain.com/index.php?section=foo&article=bar

hey - I was wondering if someone can explain to me how mod_rewrite works! I know that you can change the url / name of the a page, but what if a user copies and pastes the link... would it still work?

 

Yes it will still work. it is simply a way to have apache map one url to another. eg;

 

http://yourdomain.com/foo/bar -> http://yourdomain.com/index.php?section=foo&article=bar

 

Yes that makes sense, but ... how does apache know the difference between something it needs to "map" opposed to accessing a file called "bar" in directory "foo".

hey - I was wondering if someone can explain to me how mod_rewrite works! I know that you can change the url / name of the a page, but what if a user copies and pastes the link... would it still work?

 

Yes it will still work. it is simply a way to have apache map one url to another. eg;

 

http://yourdomain.com/foo/bar -> http://yourdomain.com/index.php?section=foo&article=bar

 

Yes that makes sense, but ... how does apache know the difference between something it needs to "map" opposed to accessing a file called "bar" in directory "foo".

You'd do this by setting up a rewrite conditions to check to see if the requested url is not a existing file/directory, example

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
# your RewriteRule's continue here

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.