Forum Moderators: phranque

Message Too Old, No Replies

Help with URL rewriting in htaccess

url rewriting not working help

         

coder4

7:07 am on Feb 19, 2009 (gmt 0)

10+ Year Member



Hi there,

i have been trying to rewrite URL but its not working anyway. I am very much fed up. I dont know the what the symbols are used for and related stuff. I am a newbie.

Please tell me how can i create a URL rewrite in htaccess that would do the following:

my actual functional page URL is
http://example.com/default.php?page=some-page-name

but i want to hide it from users and just want them to see it as:
http://example.com/pages/some-page-name.htm

I want to make sure the images,css and js path are not affected.

Thanks in advance for any help!

cheers

[edited by: jdMorgan at 4:38 pm (utc) on Feb. 24, 2009]
[edit reason] example.com [/edit]

jdMorgan

3:15 pm on Feb 19, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Please post your best-effort code as a basis for discussion.

See the documents cited in our Apache Forum Charter [webmasterworld.com]; You have almost no chance to get working code if you haven't researched what the "symbols" mean.

Thanks,
Jim

coder4

11:11 am on Feb 24, 2009 (gmt 0)

10+ Year Member



well thanks, however i got the url rewriting code done for myself. However, i have another question,

I am bit concerned when i run a link checker for my website, it shows all the pages as 404 not found (i am afraid if the crawler/spiders are treating it the same). However the same pages work fine on browsers.

for example the website http://www.example.com when run link checker tool [validator.w3.org...] most of the pages show 404 error. however when the URL is actually opened in a web browser it works fine. I have included RewriteBase / in the .htaccess code.

Can you tell me if i need to worry wrt crawlers not crawling my website.

Thanks,
aditya

[edited by: jdMorgan at 4:39 pm (utc) on Feb. 24, 2009]
[edit reason] example.com [/edit]

jdMorgan

4:40 pm on Feb 24, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



That's a very serious problem, and I would expect your site to disappear from search listings within a few days.

The HTTP protocol must be used correctly if you want your site to survive on the Web.

Jim

g1smd

7:59 pm on Feb 24, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Have you updated the links on your pages to use the URL that you want users to use to access the content?