Rredirect all pages (*.php) to URL without .php
-
gharrow
-
Topic Author
-
Offline
-
New Member
-
Less
More
-
Posts: 2
-
Thank you received: 0
-
-
11 years 4 months ago - 11 years 4 months ago #1267
by gharrow
Greetings!
So far, ReDJ has been incredibly helpful when migrating pages from an old site to a new one, as well as when rearranging menu items but wanting to not break links.
I have been manually doing page by page as I see errors come about, but I was curious if there was a relatively simple way to redirect any/all of the pages that end in ".php" to the same link, but without the .php part.
For example,
"
www.mysite.com/directory/documents.php"
would redirect to
"
www.mysite.com/directory/documents"
and that would apply for any page with a URL that ends in .php. As I've been seeing many of our old links come up in the errors and the URL is the same just without the .php, I feel like there should be a way to do it.
Thanks very much for your time!
Gregg
Last edit: 11 years 4 months ago by gharrow.
Please Log in or Create an account to join the conversation.
Less
More
-
Posts: 3194
-
Thank you received: 441
-
-
11 years 4 months ago #1268
by admin
Yes... this is the reason for ReDJ to exists...
From URL: \.php$
To URL: http://{siteurl}{pathrtrim .php}
Kind regards,
Luigi
The following user(s) said Thank You: gharrow
Please Log in or Create an account to join the conversation.
Less
More
-
Posts: 8
-
Thank you received: 0
-
-
11 years 4 months ago #1269
by js
tried this on my site, only difference was it was .mp4 instead of .php, but i can't get that to work.
Please Log in or Create an account to join the conversation.
Less
More
-
Posts: 3194
-
Thank you received: 441
-
-
11 years 4 months ago #1270
by admin
If the file with .mp4 exists there's non way to redirect cause the web server pass the file and the request is not managed by Joomla (and ReDJ).
Please Log in or Create an account to join the conversation.
Less
More
-
Posts: 8
-
Thank you received: 0
-
-
11 years 4 months ago - 11 years 4 months ago #1271
by js
it doesn't in that place. i just get a 404 page
Last edit: 11 years 4 months ago by js.
Please Log in or Create an account to join the conversation.
Less
More
-
Posts: 3194
-
Thank you received: 441
-
-
11 years 4 months ago - 11 years 4 months ago #1272
by admin
This error page is provided by the web server. You can add this line at the end of .htaccess file:
So the web server will pass the error to Joomla...
Last edit: 11 years 4 months ago by admin.
Please Log in or Create an account to join the conversation.
Time to create page: 0.224 seconds