Jump to content

[SOLVED] Mod Rewrite Redirect


Jagarm

Recommended Posts

I apologize for the confusion. The following is my .htaccess

 

Options +FollowSymlinks
RewriteEngine on
RewriteCond %{SCRIPT_FILENAME} !-f
RewriteCond %{SCRIPT_FILENAME} !-d
RewriteRule ^([^/\.]+)/?$ /index.php?display=$1 [L]
RewriteRule ^([^/\.]+)/([^/\.]+)/?$ /index.php?display=$1&action=$2 [L]

 

Now let's say I have this link now if you mouse over you will see is in the ugly format, and that is what it will display in the address bar.

 

My question here is, is there any way or flag that can display http://beta.berwari.net/contact instead of http://beta.berwari.net/index.php?display=contact?

 

I am able to convert from http://beta.berwari.net/contact to http://beta.berwari.net/index.php?display=contact but that is not what i want is the other way around.

 

I don't want the user to see http://beta.berwari.net/index.php?display=contact in the address bar, even if a link is in that format I want to convert it into the proper format that is www.domain.com/page_ :police:name

 

Sorry the site is restricted to certain sites only due to work in progress.

 

I hope I have made it clear and if not please let me know.

 

Thanks for your help

You can change what will be in the address bar by using a 301 redirect (or a 302), but you cannot change the content of a page without... changing the content of a page.  In other words, you would have to change all index.php?... links to /.....

 

 

To have your webserver redirect index.php?display=contact to /contact, you could do something like:

 

RewriteRule ^index.php?display=([^&]+)$ /$1/ [R=301,L]

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.