PitterPat
Member
Posted 3 years ago #
Hi,
I guess this should be fairly straight forward, but when I try to learn about .htaccess and rewriterule I end up buried in much more complex stuff.
My WP directory is in http://<my domain>/Wordpress but some users don't realize that they need to capitalize the "W".
So I want to rewrite wordpress to WordPress whenever it appears in a URL.
Can this be done in with an .htaccess directive in the Apache base path (/var/www/html)?
Thanks
actually its simple, there are two database options that you have to change,
in teh wp-options table, you have to change the root links
this is in your database:
i have done this, before there is two fields in the wp-options table
first one is the "siteurl" option and than "home" option
change those two to the new link
than change the folder name from capital to lower
PitterPat
Member
Posted 3 years ago #
Thanks for the feedback.
Trouble is, some users use WordPress with the capital "W" and some without.
So I want a way to accept either one.
I think this can be done with an entry in .htaccess.
Thanks
ohh i see your dilemma, ok than how about use redirect
a simple
have the lowercase go to the upper case or visa versa
<?php
header('Location: http://www.yourdomain.com/Wordpress');
?>
PitterPat
Member
Posted 3 years ago #
Hi,
Where would you put this code? It can't be in the WordPress folder because the user with the incorrect url would never get there.
Thanks
right ok so here is your structure
yourdomian.com/Wordpress this is your correct link
in yourdomain.com add a file called index.php, and add that code in there
in in yourdomain.com/wordpress add a file called index.php, and add that code in there
so you make a folder without the capital "W" and put that index file in there this will redirect the non capital to the capital folder
PitterPat
Member
Posted 3 years ago #
Thanks!
I'm going to give it a try. Sounds good.
PitterPat
Member
Posted 3 years ago #
Thank you vachi!
It works like a charm.
It's only necessary to put the code in http://yourdomain.com/wordpress/index.php (lower case wordpress). That redirects it to http://yourdomain.com/Wordpress. And everything works!
There is no need for any php in http://yourdomain.com
Thanks!