User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the Linux Servers and Apache section within the Tech Talk category of DaniWeb, a massive community of 426,809 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 1,880 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our Linux Servers and Apache advertiser: Programming Forums
Views: 3619 | Replies: 4
Reply
Join Date: Oct 2006
Posts: 5
Reputation: geekpie is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
geekpie geekpie is offline Offline
Newbie Poster

redirect to same filename without extension

  #1  
Oct 30th, 2006
Hi
I recently added
Options +Multiviews

to my .htaccess file so that URLs on my site would be

mydomain.com/features/cars

rather than

mydomain/features/cars.php

It's working fine, but I now wish to redirect bookmarked users and robots that request the old URLs.

I've tried

Redirect /features/cars.php
http://mydomain.com/features/cars

but this gives file not found: presumably as you can't redirect to the same place.
Does anyone know how to do this?

thanks in advance
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Oct 2006
Posts: 5
Reputation: geekpie is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
geekpie geekpie is offline Offline
Newbie Poster

Re: redirect to same filename without extension

  #2  
Oct 31st, 2006
I now suspect it's a job for mod_rewrite: after all you can change the URL to have the www in if the user doesn't type it:
RewriteCond %{HTTP_HOST} ^mydomain.co.uk
RewriteRule (.*) http://www.mydomains.co.uk/$1 [R=301,L]

So how do I Rewrite all filename.php requests on my site to filename

(no .php)?
cheers
geekpie
Reply With Quote  
Join Date: Aug 2007
Posts: 2
Reputation: AtlSftEngineer is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
AtlSftEngineer AtlSftEngineer is offline Offline
Newbie Poster

Question Re: redirect to same filename without extension? need help

  #3  
Aug 16th, 2007
Finally, I found a reference for this. Ok I'm fairly new to this. I'm assuming I need apache with my hosting.

Where can I find a good reference for learning how to have all the files on my website say www.website.com/file/filename.php to just say www.website.com/file/filename ?

I noticed it has something to do with a htaaccess file..

can anyone explain or send me in the right direction?

Thanks

Mike
Reply With Quote  
Join Date: Oct 2006
Posts: 5
Reputation: geekpie is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
geekpie geekpie is offline Offline
Newbie Poster

Re: redirect to same filename without extension

  #4  
Aug 16th, 2007
in your .htaccess

Options +Multiviews

see
http://httpd.apache.org/docs/1.3/con...gotiation.html

"Using a 'MultiViews' search, where the server does an implicit filename pattern match and chooses from among the results. "
Reply With Quote  
Join Date: Oct 2006
Posts: 5
Reputation: geekpie is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
geekpie geekpie is offline Offline
Newbie Poster

Re: redirect to same filename without extension

  #5  
Aug 16th, 2007
in your .htaccess

Options +Multiviews

see
http://httpd.apache.org/docs/1.3/con...gotiation.html

"Using a 'MultiViews' search, where the server does an implicit filename pattern match and chooses from among the results. "
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb Linux Servers and Apache Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the Linux Servers and Apache Forum

All times are GMT -4. The time now is 7:52 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC