__________________ Unless otherwise stated, any code posted is most likely untested and may contain syntax errors.
My posts, comments, code, and suggestions reflect only my personal views.
Web Portfolio and Code Snippets: http://shanechism.com
I keep re-reading but I can't customize Apache stuff at all. I have no idea on the syntax and codes or anything. Could you give me the code to make every url in a sub-folder appear like it's in the root folder and then I can just switch out sub-folder names to customize it? I don't have any dynamically created pages.
The method there is geared towards dynamic pages but it can be adjusted to static as well. As for modifying Apache you can use this with an .htaccess file. Create a file named ".htaccess" and place it in the root of your web directory (typically public_html/ or www/).
Now unfortunately I don't have access to an Apache installation and I'm terrible at REGEX. So I'll do my best to help you out however if anyone else is viewing this that has a better method please chime in.
In your .htaccess file try putting in:
Code:
RewriteEngine On
RewriteBase /
RewriteRule ^(.*)$ sunday/$1
Let me know what happens and we can take it from there.
__________________ Unless otherwise stated, any code posted is most likely untested and may contain syntax errors.
My posts, comments, code, and suggestions reflect only my personal views.
Web Portfolio and Code Snippets: http://shanechism.com
Did you also include RewriteEngine On? And your .htaccess, or the rewrite part anyway, should appear exactly as in my post (in that order and all).
__________________ Unless otherwise stated, any code posted is most likely untested and may contain syntax errors.
My posts, comments, code, and suggestions reflect only my personal views.
Web Portfolio and Code Snippets: http://shanechism.com
Edit:These won't work. I'm trying some things on my Apache server. I'll post back if I have anything.
Okay, three ideas.
First, try putting the RewriteRule I posted below all the other RewriteRules.
Second, try using this RewriteRule instead:
Code:
RewriteRule ^/(.*)$ sunday/$1
Third, if you remove this RewriteRule does the server error go away?
__________________ Unless otherwise stated, any code posted is most likely untested and may contain syntax errors.
My posts, comments, code, and suggestions reflect only my personal views.
Web Portfolio and Code Snippets: http://shanechism.com
Try out some of those methods and post back. As soon as I get some more time I'll try some different methods. I'm surprised this is proving so difficult!
__________________ Unless otherwise stated, any code posted is most likely untested and may contain syntax errors.
My posts, comments, code, and suggestions reflect only my personal views.
Web Portfolio and Code Snippets: http://shanechism.com
I'll check the site out. Thanks for your help so far. My difficulty is I can't find anywhere to learn what ^ / $ (.) or the order of any of that does. I know * is a wild card but that's about it and it makes it impossible to play around with it.
EDIT: I'm sooooooo close now. The following changes my url:
root/sunday/file <--old url
root/file <--new url
Code:
RewriteRule ^sunday/(.*)$ /$1 [R=301,NC,L]
But it goes to a 404 page because the file really is in "root/sunday/file" I just want it to display as "root/file".
That actually isn't doing what you want it to do, I think.
What you have set up right now is a redirect. So it's redirecting from root/sunday/file to root/file. It's not, which I think you want it to, seeing root/file as the URL but looking in root/sunday/file for the file.
Am I correct in assuming that's what you want it to do?
__________________ Unless otherwise stated, any code posted is most likely untested and may contain syntax errors.
My posts, comments, code, and suggestions reflect only my personal views.
Web Portfolio and Code Snippets: http://shanechism.com
You're exactly right. That's why I tried removing the R=301 to see if you would just "rewrite" the displayed url. Thanks for the cheat sheet it clears up a lot.