Forum Moderators: phranque
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^user/account.php index.php?page=custom&file=paypal/user_menu_pack.php [L]
RewriteRule ^user/watchlist.php index.php?page=custom&file=watchlist/watchlist.php [L]
RewriteRule ^user/promocode.php index.php?page=custom&file=promo_codes/user_promo_code.php [L]
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule> I want the redirect to apply if a person visits domain.com/user/account (without the trailing .php)
RewriteRule ^index\.php$ - [L] href="/user/account" from the pages of your site. URLs are defined in links. htaccess cannot change a URL, it can only act on a URL request after a link has been clicked. RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /user/account.php\ HTTP/
RewriteRule ^user/account.php http://www.example.com/user/account [R=301,L] RewriteRule ^user/account$ /index.php?page=custom&file=paypal/user_menu_pack.php [L] user/account.php doesn't exist as an actual file on the server.
I couldn't get rewrites working with site.com/user/account unless I appended a file extension
htaccess cannot change a URL, it can only act on a URL request after a link has been clicked.
Beware that unescaped slashes are NOT a valid character within query string parameters. That may cause you some trouble.
I couldn't get rewrites working with site.com/user/account unless I appended a file extension
Uh-oh, there's something wrong here. Are there any other rules you haven't told us about?
Beware that unescaped slashes are NOT a valid character within query string parameters. That may cause you some trouble.Urk! Isn't there a question about that, just a few posts further down this forum? If you do have a slash, does something break outright or are you just left with an unhappy php page plotting revenge?
The OP is merely asking how to modify those rules.
My goal is to get the rewrite to work without requiring the .php at the end. - Is this possible?
Please forgive me for getting redirects and rewrites mixed up - typing before brain engaged.