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

Link to comment
Share on other sites

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]

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.