captaintyson Posted July 15, 2010 Share Posted July 15, 2010 Hi Guys, I'm working with a client who needs to do a HTACCESS redirect. I need to redirect it so that when someone goes to the url it would be "www.url.org/page/portfolio" instead of "www.url.org/?page=portfolio". I tried using this http://www.iwebtool.com/htaccess_url_rewrite to get this: Options +FollowSymLinks RewriteEngine on RewriteRule /page/(.*)\.php ?page=$1 And this code that a friend gave me: RewriteEngine on RewriteRule page/(.*)/ index.php?page=$1 RewriteRule page/(.*) index.php?page=$1 But didn't have any success. Any of the fellow geeks around here know what I'm doing wrong? Thanks in advance! I'm brain dead and this is the only SEO friendly way! Link to comment https://forums.phpfreaks.com/topic/207809-htaccess-redirect-with-php-code/ Share on other sites More sharing options...
captaintyson Posted July 15, 2010 Author Share Posted July 15, 2010 Solved. RewriteEngine On RewriteRule ^([a-zA-Z0-9_-]+)$ index.php?page=$1 RewriteRule ^([a-zA-Z0-9_-]+)/$ index.php?page=$1 Link to comment https://forums.phpfreaks.com/topic/207809-htaccess-redirect-with-php-code/#findComment-1086316 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.