Forum Moderators: phranque
I did a lot of searching on the Internet (including some threads on this forum), and found that others have had similar difficulties. This isn't specific to Vista; people have had the same problems on XP and 2000.
I've decided do this by placing .htaccess files on the host server, which is a Linux account, and using a test home page to debug it. I'll just use "real" URLs on my development PC.
Have others here been forced to the same conclusion?
but attempts to rewrite fail.
I.e. HTTP 404 for requests which should match your rule? Please make sure that
AllowOverride FileInfo is set for that directory and post - the physical and URL path to your .htaccess file
- the way teh request was mapped to the file system (you're talking about an Alias, so you're using
Alias / "C:/path.../"? Yes, I'm getting HTTP 404s, and AllowOverride is set to All for that directory. Otherwise:
- Physical path: C:\Users\MyName\Documents\MyProject\MyDomain
(no spaces anywhere).
- Corresponding URL: [localhost...]
- Alias Directive: Alias /MyDomain C:/Users/MyName/Documents/MyProject/MyDomain
- Path requested: [localhost...]
- Rewrite rules:
RewriteBase /MyDomain
RewriteRule ^/MyDomain/page1\.html$ /page2.html
plus many different permutations of this humble attempt at creating a rewrite rule. By this point I could write a book about writing rewrite rules, but I'd have to rewrite it if I ever figure out how to rewrite correctly.
This site was the best resource for me getting started:
[yourhtmlsource.com...]
Also can you please post your Rewrite commands?
Here is one of mine for reference, but there are a number of ways to doing it:
---------------------------------------
# Rewrite URL for SEO #
Options +FollowSymLinks
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
## Index Pages ##
RewriteRule ^events/index/([A-Za-z]+)$ /eventinfo/index.php?region=$1
I moved
RewriteEngine on
out of httpd.conf and into .htaccess. I then comment out all text except for that one line (the same result happens whether I do or don't). Once that has been done, trying to access any page, even ones that I can normally access, produces an HTTP 403 - Forbidden. In the FF window the following message appears:
"You don't have permission to access /MyDomain/whatever.html on this server."
Trying [localhost...] which normally lets me view index.html returns a 403 with
"You don't have permission to access /MyDomain/ on this server."
Does this make sense to anyone?
produces an HTTP 403
You don't have FollowSymlinks enabled, see the Options [httpd.apache.org] directive. That should tell you your error.log as well.