homepage Welcome to WebmasterWorld Guest from 54.211.97.242
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Home / Forums Index / Code, Content, and Presentation / Apache Web Server
Forum Library, Charter, Moderators: Ocean10000 & incrediBILL & phranque

Apache Web Server Forum

This 37 message thread spans 2 pages: 37 ( [1] 2 > >     
Rewrite .php extension to virtual folder
Rewrite .php extension to virtual folder
jabz

5+ Year Member



 
Msg#: 4084680 posted 10:45 am on Feb 22, 2010 (gmt 0)

Hi,

I've been looking and reading for hours and even this post: [webmasterworld.com ], which reads similar to my problem, did not really help me.

So, what I need is a set of rewrite conditions/ rules to rewrite my .php file extensions to a virtual folder at best I'm also forcing a trailing slash.

To make it a little extra complicated: the website is 3 lingual. Each language has it's own directory. Apart from that, there are no other directories.

example.com/english/
example.com/french/
example.com/spanish/

For this example I will use the english dir:

example.com/english/ contains about 10 .php-files. What I wanna do is to display those .php-files as virtual folders.

example.com/english/index.php -> example.com/english/
example.com/english/news.php -> example.com/english/news/
example.com/english/press.php -> example.com/english/press/
etc.

My .htaccess still is quite basic:

Options +Indexes
Options +FollowSymlinks

RewriteEngine on
RewriteBase /

# redirect all non-canonical hostname requests to canonical hostname
RewriteCond %{HTTP_HOST} .
RewriteCond %{HTTP_HOST} !^www\.example\.com$
RewriteRule (.*) http://www.example.com/$1 [R=301,L]


Everything I've tried so far did not work...I don't know why, as I have some experience with rewriting...but this time, I need your help.

Thanks in advance.

 

g1smd

WebmasterWorld Senior Member g1smd us a WebmasterWorld Top Contributor of All Time 10+ Year Member



 
Msg#: 4084680 posted 11:16 am on Feb 22, 2010 (gmt 0)

RewriteRule ^pattern-for-the-path-part-of-URL-request /place-inside-server-where-content-resides [L]

You can use ( ) to capture path fragments from the URL request and re-use them as $1, $2, etc, in the server-internal target.

--

Don't link to 'index.php'. Link to URL ending in trailing slash only.

Use DirectoryIndex index.php to map requests for folders to that file.

--

Once you have the rewrites working, you'll also need to redirect direct client URL requests for URLs containing .php to the new URLs. That will need a RewiteCond checking THE_REQUEST as well as the RewriteRule for the redirect.

There was a very similar question a few days ago, and answers there have much longer code examples.

jabz

5+ Year Member



 
Msg#: 4084680 posted 12:11 pm on Feb 22, 2010 (gmt 0)

@g1smd - Thanks so far. I've made some additions to my .htaccess. For index-files it's already working, trailing slahes are forced as well:


Options +Indexes
Options +FollowSymlinks

RewriteEngine on
RewriteBase /en/

# redirect all non-canonical hostname requests to canonical hostname
RewriteCond %{HTTP_HOST} .
RewriteCond %{HTTP_HOST} !^www\.example\.com$
RewriteRule (.*) http://www.example.com/$1 [R=301,L]

# rewrite .php extension to virtual folder
# RewriteRule ^pattern-for-the-path-part-of-URL-request /place-inside-server-where-content-resides [R=301,L]

# redirect index.php to folder
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /.*index\.php\ HTTP/
RewriteRule ^(.*)index\.php$ http://%{HTTP_HOST}/$1 [R=301,L]

# force trailing slash
RewriteCond %{REQUEST_URI} !(.*)/$


Now the path-pattern... I need an example for that. I do not really understand the part "place-inside-server-where-content-resides". My plan is to put the .htaccess in root. For this rule, I do not need to specify places or am I wrong?

Edit: I'm wrong, just saw that my RewriteBase is /en/, no wonder it's working. OK, I need help. :) Could you give me an example?

g1smd

WebmasterWorld Senior Member g1smd us a WebmasterWorld Top Contributor of All Time 10+ Year Member



 
Msg#: 4084680 posted 12:20 pm on Feb 22, 2010 (gmt 0)

Firstly, you MUST fix the rule order.

The redirects must be listed first, with the general non-www to www redirect as the last redirect.

Inspect them to be sure that for any request only one rule can match. If one rule matches and does a redirect, then another rule matches and does another redirect you are in trouble.

After the redirects, list the rewrites. Never list the rewrites before the redirects.

[edited by: g1smd at 12:30 pm (utc) on Feb 22, 2010]

jdMorgan

WebmasterWorld Senior Member jdmorgan us a WebmasterWorld Top Contributor of All Time 10+ Year Member



 
Msg#: 4084680 posted 12:22 pm on Feb 22, 2010 (gmt 0)

To clarify, one reason you're having problems is that

So, what I need is a set of rewrite conditions/ rules to rewrite my .php file extensions to a virtual folder ...

is exactly backwards.

You actually want to internally rewrite extensionless URLs used as links on your pages to .php files located inside your server.

To emphasize this even a bit more, understand that a URL 'exists' as soon as you (or someone else) defines it by linking to it. It makes no difference whether that URL resolves to a file on a server somewhere; the URL exists as soon as it is 'mentioned' in a link anywhere on the Web.

In contrast, a file exists on your server as soon as you create it or upload it there, regardless of whether there is a URL in a link that will resolve to it.

URLs and files actually have nothing whatsoever to do with each other, except that a server's primary function is to map its assigned domain's URL-space into its internal filespace.

With that in mind, the first response in this thread may become clearer: You need to take three steps. In conceptual order, they are:

First edit your HTML pages and/or the scripts that produce the HTML of your pages, and remove the .php extensions from your links.

Next, you want to internally rewrite these new extensionless URLs, when requested by HTTP clients from your server, to the currently-existing files (still) having .php extensions inside your server.

In practical order, you'll really want to have the rules in place before changing your links, but it seems to be helpful to describe these two steps in reverse. That's because it seems that it's easier for readers to understand when when we say, "Change your links, then make your server recognize the new links and point them to the old files."

Once these first two steps are is working, you'll then want to get rid of .php extensions on URLs saved as clients bookmarks, linked-to by third-party Web sites beyond your control, and currently indexed and listed in search engine results. So now, the recommendation supplied by g1smd above comes in: You'll want to externally redirect only direct client requests for the old URLs ending in .php to the new URLs having no extension.

Note that an internal rewrite is a URL-to-filepath translation, while an external redirect is a URL-to-URL translation. An external redirect doesn't even access a file; it is a server response telling the client, "That resource has moved, ask for it again using this new URL."

This thread [webmasterworld.com] may be of some assistance. Please note that the thread title was chosen by the original poster.

Jim

g1smd

WebmasterWorld Senior Member g1smd us a WebmasterWorld Top Contributor of All Time 10+ Year Member



 
Msg#: 4084680 posted 12:24 pm on Feb 22, 2010 (gmt 0)

Rewrite: example.com/english/news (URL) => /english/index.php (internal filepath)

RewriteRule ^english/news/$ /english/news.php [L]


More general pattern would be:

RewriteRule ^([^/]+)/([^/]+)/$ /$1/$2.php [L]

Personally, I would NOT use a trailing slash on these URLs. I would use 'extensionless' /english/news instead.

You also need to add the redirect from .php URLs (and it should redirect for both www and non-www) to extensionless URLs (and it should force www for those requests in the same redirect).

jabz

5+ Year Member



 
Msg#: 4084680 posted 12:28 pm on Feb 22, 2010 (gmt 0)

Got it, this is what I have now:

# NEVER LIST REWRITES BEFORE REDIRECTS, IDIOT!

Options +Indexes
Options +FollowSymlinks

RewriteEngine on
RewriteBase /en/

# rewrite .php extension to virtual folder
# RewriteRule ^pattern-for-the-path-part-of-URL-request /place-inside-server-where-content-resides [R=301,L]

# redirect index.php to folder
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /.*index\.php\ HTTP/
RewriteRule ^(.*)index\.php$ http://%{HTTP_HOST}/$1 [R=301,L]

# force trailing slash
RewriteCond %{REQUEST_URI} !(.*)/$

# redirect all non-canonical hostname requests to canonical hostname
RewriteCond %{HTTP_HOST} .
RewriteCond %{HTTP_HOST} !^www\.example\.com$
RewriteRule (.*) http://www.example.com/$1 [R=301,L]

g1smd

WebmasterWorld Senior Member g1smd us a WebmasterWorld Top Contributor of All Time 10+ Year Member



 
Msg#: 4084680 posted 12:36 pm on Feb 22, 2010 (gmt 0)

Redirects have [R=301,L] flags.

Redirect target should always contain protocol and domain name.

Rewrites have only [L] flag.

Rewrite target is an internal server filepath (so protocol and domain name isn't mentioned).


List the rewrites after the redirects.

Your last example has multiple errors and hasn't yet coded in half of the things we already covered above. There's several more redirects and rewrites to add.

jabz

5+ Year Member



 
Msg#: 4084680 posted 12:52 pm on Feb 22, 2010 (gmt 0)

OK, I see I got a lot to learn.

@ jdmorgen:
You are right, thank you for the clarification.

Changes so far:

- deleted R=301 from rewrite flags
- kicked out the force for the trailing slash, as only directories have a slash and filenames don't.

Are there any more errors?


# NEVER LIST REWRITES BEFORE REDIRECTS, IDIOT!

Options +Indexes
Options +FollowSymlinks

RewriteEngine on
RewriteBase /

# url to filepath
RewriteRule ^([^/]+)/([^/]+)/$ /$1/$2.php [L]

# redirect index.php to folder
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /.*index\.php\ HTTP/
RewriteRule ^(.*)index\.php$ http://%{HTTP_HOST}/$1 [L]

# redirect all non-canonical hostname requests to canonical hostname
RewriteCond %{HTTP_HOST} .
RewriteCond %{HTTP_HOST} !^www\.example\.com$
RewriteRule (.*) http://www.example.com/$1 [R=301,L]



Thank you for your help.
Please excuse that it's taking some time for me to answer/ update the thread. I'm reading and try to learn...

g1smd

WebmasterWorld Senior Member g1smd us a WebmasterWorld Top Contributor of All Time 10+ Year Member



 
Msg#: 4084680 posted 1:49 pm on Feb 22, 2010 (gmt 0)

We're going backwards as fast as we're going forwards.

The latest code still has the rewrite before the redirects.

It also has a rule that includes the domain name (so it is a redirect) but no R=301 part, so it produces a 302 redirect.

It's important that YOU learn to spot these errors, so that you can maintain your code on your site.

If it has a domain name and/or an R flag it is a redirect. Perfect code for a redirect has BOTH of those things.

If it has no domain name and no R flag, it is a rewrite.

A redirect maps a URL request to a new URL (forces the browser to request the new URL).

A rewrite maps a URL request to an internal server path (content is served at the requested URL).

Still to do:

- redirect URL requests for .php URLs to new URL.


Correct order:

# Redirect index.php URL request to new / or /folder/ URL.
# Redirect other .php URL requests to new name URL.
# Redirect non-www URL request to www URL.

# Rewrite new name URL request to .php file.


There's better code you can use for the index redirect. Code with .* in the pattern runs very inefficient.


You also need to add the
DirectoryIndex index.php statement ahead of all of this stuff.
jabz

5+ Year Member



 
Msg#: 4084680 posted 5:00 pm on Feb 22, 2010 (gmt 0)

First of all,...thanks for the little set of rules outlined above. Just bought a book on regular expressions on ebay, I think I need some more basic background knowledge.

Hope I got it right...as far as I understand I have two redirects and one rewrite:

Options +Indexes
Options +FollowSymlinks

RewriteEngine on
RewriteBase /

DirectoryIndex index.php

# REDIRECT index.php to folder
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /.*index\.php\ HTTP/
RewriteRule ^(.*)index\.php$ http://%{HTTP_HOST}/$1 [L]

# REDIRECT all non-canonical hostname requests to canonical hostname
RewriteCond %{HTTP_HOST} .
RewriteCond %{HTTP_HOST} !^www\.example\.com$
RewriteRule (.*) http://www.example.com/$1 [R=301,L]

# REWRITE url to filepath
RewriteRule ^([^/]+)/([^/]+)/$ /$1/$2.php [L]


What confuses me is that this does not match the "correct order" in your post above.


Regarding the index redirect with the .* in the pattern. What do you suggest is better? My investigation on Google brought up this snippet all the time.

g1smd

WebmasterWorld Senior Member g1smd us a WebmasterWorld Top Contributor of All Time 10+ Year Member



 
Msg#: 4084680 posted 5:52 pm on Feb 22, 2010 (gmt 0)

Rules with .* within are usually very inefficient.

This replacement code gets posted several times each week, and fixes those problems:

# Force requests for named index files to drop the index file filename, and force www:
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /([^/]*/)*index\.(html?|php[45]?)(\?[^\ ]*)?\ HTTP/
RewriteRule ^(([^/]*/)*)index\.(html?|php[45]?)$ http://www.example.com/$1 [R=301,L]


--

You need one more redirect after the first listed redirect. It needs to redirect requests for .php URL requests other than those for index.php URLs. It will strip the filename and force the www at the same time.

--

Look again at your first redirect. It is still missing the R=301 flag. Additionally, the domain name needs to be hard-coded into the redirect target. Don't use %{HTTP_HOST} otherwise you will end up with a redirection chain for non-www requests that match both redirects. Here's a post with some code that is 'almost' right, with comments as to why it has problems: [webmasterworld.com...]

What you want is for one (and only one) of the three redirects to match what you need to fix and to fix all problems in one hit. The replacement code above does that.

That is, the first redirect will redirect for any index.php URL request for any folder and for both www and non-www requests. The redirect strips the filename and forces the www domain at the same time.

The next redirect (missing at the moment) fixes .php requests (other than for index.php). It strips the filename, and forces the www at the same time.

The final redirect fixes the www for any non-www URL request not already fixed up by previous redirects.

After the three redirects, there's the rewrite to handle the correct URL requests.

jabz

5+ Year Member



 
Msg#: 4084680 posted 9:39 pm on Feb 22, 2010 (gmt 0)

Thank you for the snippet.

So far I got this:

Options +Indexes
Options +FollowSymlinks

RewriteEngine on
RewriteBase /

DirectoryIndex index.php

# REDIRECT Force requests for named index files to drop the index file filename, and force www:
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /([^/]*/)*index\.(html?|php[45]?)(\?[^\ ]*)?\ HTTP/
RewriteRule ^(([^/]*/)*)index\.(html?|php[45]?)$ http://www.example.com/$1 [R=301,L]

# REDIRECT all non-canonical hostname requests to canonical hostname
RewriteCond %{HTTP_HOST} .
RewriteCond %{HTTP_HOST} !^www\.example\.com$
RewriteRule (.*) http://www.example.com/$1 [R=301,L]


You are teaching me a lesson here, you know that. :) Feels like I can can ask questions:

#1 From your comment in the other thread I understand that (apart from other changes) [%{HTTP_HOST}...] was dumped in favor of the hard-coded domain name (www-version) to avoid redirect chains, right?

#2 You wrote "Don't use %{HTTP_HOST}" (if there is no additionally hard-coded domain name in the redirect target). So the last rule above is fine because I got example.com in there, right?

#3 The index redirect is supposed to come first as it more specific and should come before the more general "fix all my non-www" redirect, right?

I think I've learned something here. I did not know that redirect chains can also appear internally. Until now I only take care of them externally.

---
NEW: I believe the next steps have not been discussed so far. If the above part of my .htaccess looks good, I'd love to get more insights.

Thanks a billion so far.

g1smd

WebmasterWorld Senior Member g1smd us a WebmasterWorld Top Contributor of All Time 10+ Year Member



 
Msg#: 4084680 posted 10:00 pm on Feb 22, 2010 (gmt 0)

1, 2, 3 : yes, yes, yes.

There's one more new redirect to go in (between the other two redirects), and your rewrite to add after everything else.

jabz

5+ Year Member



 
Msg#: 4084680 posted 10:15 pm on Feb 22, 2010 (gmt 0)

Ok, I've added the rewrite as well...

Options +Indexes
Options +FollowSymlinks

RewriteEngine on
RewriteBase /

DirectoryIndex index.php

# REDIRECT Force requests for named index files to drop the index file filename, and force www to avoid redirect chains:
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /([^/]*/)*index\.(html?|php[45]?)(\?[^\ ]*)?\ HTTP/
RewriteRule ^(([^/]*/)*)index\.(html?|php[45]?)$ http://www.example.com/$1 [R=301,L]

# REDIRECT all non-canonical hostname requests to canonical hostname
RewriteCond %{HTTP_HOST} .
RewriteCond %{HTTP_HOST} !^www\.example\.com$
RewriteRule (.*) http://www.example.com/$1 [R=301,L]

# REWRITE url to filepath
RewriteRule ^([^/]+)/([^/]+)/$ /$1/$2.php [L]


Can you help me out with the missing parts?

#1 fix for .php requests (other than for index.php). It strips the filename, and forces the www at the same time.

#2 final redirect fixes the www for any non-www URL request not already fixed up by previous redirects.

#3 the rewrite to handle the correct URL requests.

Can't do it alone.

[edited by: jabz at 10:30 pm (utc) on Feb 22, 2010]

g1smd

WebmasterWorld Senior Member g1smd us a WebmasterWorld Top Contributor of All Time 10+ Year Member



 
Msg#: 4084680 posted 10:20 pm on Feb 22, 2010 (gmt 0)

Items #2 and #3 in your list are already done, and are in the correct order.

The new extra redirect goes between the other two redirects, and it needs to redirect /english/news.php direct client URL requests to the new URL of www.example.com/english/news/ for example (and same again for other languages and categories).

jabz

5+ Year Member



 
Msg#: 4084680 posted 10:28 pm on Feb 22, 2010 (gmt 0)

You mean in this form?

RewriteRule ^english/news.php http://www.example.com/english/news/ [R=301,L]

For every path and file? Isn't there a a solution that tackles all paths/ files at once?

g1smd

WebmasterWorld Senior Member g1smd us a WebmasterWorld Top Contributor of All Time 10+ Year Member



 
Msg#: 4084680 posted 10:35 pm on Feb 22, 2010 (gmt 0)

Something like that, but you can probably use the normal
^([^/]+)/([^\.]+)\.php pattern to match these URL requests, and then use $1 and $2 as the substitution/target. As it is a redirect it will also need the domain name and the R=301 and L flags as before.

You'll also need a
RewriteCond looking at %{THE_REQUEST} to detect the fact the request came from the client, not as the result of any internal rewriting action.

It's going to work something like the index redirect already coded, but with slightly different features.

jabz

5+ Year Member



 
Msg#: 4084680 posted 11:03 pm on Feb 22, 2010 (gmt 0)

I feel like I'm messing this up. This is what I came up with so far:

RewriteCond %{THE_REQUEST} ^([^/]+)/([^\.]+)\.php /$1/$2.php [R=301,L]
RewriteRule ^(english¦french)/([^/]+)/([^/]+)\.php ...[R=301,L]


I need to study further...
Would you help me out with the complete set?

g1smd

WebmasterWorld Senior Member g1smd us a WebmasterWorld Top Contributor of All Time 10+ Year Member



 
Msg#: 4084680 posted 11:21 pm on Feb 22, 2010 (gmt 0)

The last bit of code you need is for the '.php URL' to 'simple URL' redirect, including domain name and R=301,L flags.

Is there only two languages? Something like...

RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /([^/]+)/([^\.]+)\.php\ HTTP/
RewriteRule ^(english¦french)/([^.]+)\.php$ http://www.example.com/$1/$2 [R=301,L]


Totally untested, and might need adjusting (especially if any of the .php URLs have parameters attached).

This new code goes after the index redirect and before the non-www redirect.

Too many people come to this forum and want a free handout of code without being prepared to have a go themselves, and with absolutely no intention to learn. You've had a really good bash at getting this coded up, and I commend you for that. Further reading in this forum and in the official docs will fill in the small number of gaps in your knowledge. In all of this, you need to look at everything in terms of URL requests and server responses.

[edited by: g1smd at 11:37 pm (utc) on Feb 22, 2010]

jabz

5+ Year Member



 
Msg#: 4084680 posted 11:32 pm on Feb 22, 2010 (gmt 0)

I have tested...

/en/news.php -> working
/en/news -> 404
/en/news/ -> 404, however, found documents with names similar to the one you requested. Available documents:* /en/news.php

(at least this is how 1&1 handles it...)

The actual directory is not english, it's "en". There are also german (/de/) and arabic (/ar/).


Edit: Is this "¦" supposed to be a pipe? I remember reading something about the pipe char not working on webmasterworld a while back...

I've tested this snippet with a pipe |:

/en/news.php -> redirecting to /en/news
/en/news -> 404
/en/news/ -> 404, however, found documents with names similar to the one you requested. Available documents:* /en/news.php

g1smd

WebmasterWorld Senior Member g1smd us a WebmasterWorld Top Contributor of All Time 10+ Year Member



 
Msg#: 4084680 posted 11:41 pm on Feb 22, 2010 (gmt 0)

The ¦ needs to change to a | pipe.

You might be better off having no trailing slash on some of your new URLs; so /en/news instead of /en/news/ here.

The rewrite would need to be adjusted to suit:
RewriteRule ^([^/]+)/([^/]+)/$ /$1/$2.php [L]
becomes:
RewriteRule ^([^/]+)/([^/.]+)$ /$1/$2.php [L]
(two changes)


The reason for that is URLs ending with a slash represent physical folders on the harddrive. Without the trailing slash, you have an 'extensionless' URL, and that is likely to be preferable to both users and searchengines.

The bare /en/ folder URL would likely remain as /en/ as it looks like a folder.

jabz

5+ Year Member



 
Msg#: 4084680 posted 11:57 pm on Feb 22, 2010 (gmt 0)

Got it, files don't deserve the slash. Clear so far.
How can I get rid of the trailing slash?

g1smd

WebmasterWorld Senior Member g1smd us a WebmasterWorld Top Contributor of All Time 10+ Year Member



 
Msg#: 4084680 posted 12:04 am on Feb 23, 2010 (gmt 0)

Link to URLs without a trailing slash in the links on your page.

It is links that define URLs.

DO link to /en/ (with slash), and DO link to /en/news (without slash).

It is the rewrite that takes that URL request and finds the place inside the server to get the content from.

It is the redirects that make the browser request a different URL when they ask for the wrong one (e.g. when asking for .php URLs).

g1smd

WebmasterWorld Senior Member g1smd us a WebmasterWorld Top Contributor of All Time 10+ Year Member



 
Msg#: 4084680 posted 12:06 am on Feb 23, 2010 (gmt 0)

You might also need to turn off MultiViews or AcceptPathInfo or whatever it is that I suspect might also be interfering with something here.

I'm not well-versed in either of those things, so can't offer a lot of advice on either one. There might be some other typo that I have so far missed.

jabz

5+ Year Member



 
Msg#: 4084680 posted 12:12 am on Feb 23, 2010 (gmt 0)

I have made the changes in the REWRITE:

Options +Indexes
Options +FollowSymlinks

RewriteEngine on
RewriteBase /

DirectoryIndex index.php

# REDIRECT Force requests for named index files to drop the index file filename, and force www to avoid redirect chains:
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /([^/]*/)*index\.(html?|php[45]?)(\?[^\ ]*)?\ HTTP/
RewriteRule ^(([^/]*/)*)index\.(html?|php[45]?)$ http://www.example.com/$1 [R=301,L]

RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /([^/]+)/([^\.]+)\.php\ HTTP/
RewriteRule ^(en|de|ar)/([^.]+)\.php$ http://www.example.com/$1/$2 [R=301,L]

# REDIRECT all non-canonical hostname requests to canonical hostname
RewriteCond %{HTTP_HOST} .
RewriteCond %{HTTP_HOST} !^www\.example\.com$
RewriteRule (.*) http://www.example.com/$1 [R=301,L]

# REWRITE url to filepath
RewriteRule ^([^/]+)/([^/.]+)$ /$1/$2.php [L]


However,...

/en/ -> working
/en/news -> 404
/en/news.php -> redirect to /en/news
/en/news/ -> 404, however, found documents with names similar to the one you requested. Available documents:* /en/news.php

the result does not change. I'm stuck...


Edit: AcceptPathInfo Off -> 500; MultiViews off -> 500

[edited by: jabz at 12:18 am (utc) on Feb 23, 2010]

g1smd

WebmasterWorld Senior Member g1smd us a WebmasterWorld Top Contributor of All Time 10+ Year Member



 
Msg#: 4084680 posted 12:18 am on Feb 23, 2010 (gmt 0)

Did you clear/flush the browser cache before retesting?

jabz

5+ Year Member



 
Msg#: 4084680 posted 12:19 am on Feb 23, 2010 (gmt 0)

Yes, I'm testing on several systems/ browsers (Firefox & Opera) with no caching at all.

g1smd

WebmasterWorld Senior Member g1smd us a WebmasterWorld Top Contributor of All Time 10+ Year Member



 
Msg#: 4084680 posted 12:31 am on Feb 23, 2010 (gmt 0)

Delete the

RewriteBase /

line. I don't think that is needed.

jdMorgan

WebmasterWorld Senior Member jdmorgan us a WebmasterWorld Top Contributor of All Time 10+ Year Member



 
Msg#: 4084680 posted 12:33 am on Feb 23, 2010 (gmt 0)

"...found documents similar..."

Change your options to prevent likely interference w/your rules.

Options +Indexes +FollowSymlinks -MultiViews

Jim

This 37 message thread spans 2 pages: 37 ( [1] 2 > >
Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / Apache Web Server
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved