Jump to content

Recommended Posts

ok, i am looking to add some mod rewrite to my sites which have long url's

 

I have seen a few things but don't get them, can some explain how i can rewrite a url.

 

I want to start simple

e.g.

 

mysite.com/page.php

 

to be

mysite.com/Page

 

Thanks,

Blade

Link to comment
https://forums.phpfreaks.com/topic/128610-solved-mod-rewrite-help/
Share on other sites

as a novice as well, here is what I used

 

Options +FollowSymLinks
Options +Indexes
RewriteEngine On
RewriteRule ^([A-Za-z0-9-]+)/?$ user/profile.php?user=$1 [L]

 

what is say is this: it allows the string to contain numbers and letters, it uses the file under the user directory called profile.php

 

then it takes the ?user=username, so it all comes out to site.com/username

I tried that wildteen, putting a / after home

site.com/Home/

 

And then also tried using your code, both produce 404 errors again.

 

How do i know if my server is set up correct (i am using WAMP)

 

@lamez, i am just doing basic rewriting ,e.g. page.php = /page/

 

So i don't that code yet.

This is wierd

RewriteRule  Home /Property-Agent/index.php [NC,L]
RewriteRule  News /Property-Agent/news.php [NC,L]
RewriteRule  Search /Property-Agent/search.php [NC,L]

 

Search and News causes 500 Internal Server Error

 

Internal Server Error

 

The server encountered an internal error or misconfiguration and was unable to complete your request.

 

Please contact the server administrator, admin@localhost and inform them of the time the error occurred, and anything you might have done that may have caused the error.

 

More information about this error may be available in the server error log.

C:\wamp\www\Property-Agent\.htacccess

And all the site files are located there.

 

From the log

[Thu Oct 16 19:54:45 2008] [error] [client 127.0.0.1] script 'C:/wamp/www/news.php' not found or unable to stat

 

Thats the wrong path but the path i specified is

RewriteRule  ^News /Property-Agent/news.php [NC,L]

 

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.