0

I am on a godaddy server now and trying this mod-rewrite stuff and it is still not working.
I have been searching google now for hours looking for the answer and cannot find it.

Here is my entire .htaccess file:
#Rewrite Rules
Options -MultiViews
Options +FollowSymLinks +Indexes
RewriteEngine on
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}.php -f
RewriteRule ^(.*)(/?)$ index.php?p=$1 [L]

#RewriteEngine On
#RewriteBase /
#RewriteCond %{REQUEST_FILENAME} !-f
#RewriteCond %{REQUEST_FILENAME} !-d
#RewriteCond %{REQUEST_FILENAME}.php -f
#RewriteRule ^(.+)$ /$1.php [L,QSA]
#RewriteRule ^c/([^/.]+)/?$ index.php?p=$1 [L]


The stuff thats commented out is what I tried the first time, then I tried many many other ways to try and get this to work with no luck.
Thanks,
Brian

3
Contributors
10
Replies
11
Views
6 Years
Discussion Span
Last Post by smantscheff
0

Anyone have any insight on this?

... the weird thing is I got an email saying someone replied to this and I dont see anything.

0

What do you mean with "is not working"?
Your rule RewriteCond %{REQUEST_FILENAME}.php -f requests that for a request like /abc the file named /abc.php exists. Is that what you want?
Your last rule will never catch anything in its second pair of brackets. In RewriteRule ^(.*)(/?)$ index.php?p=$1 [L] the first bracket pair catches all content.

0

My goal is to get a domain like this domain.com/training or domain.com/contact instead of domain.com/index.php?p=training.

I have checked numerous sites even a thread on here doing the same exact thing using the same exact example, and i believe he was also using a godaddy server. I used his same code and got nothing, eventually just confused myself because I have used so many different snippets from all over.

0

Anyone have any insight on this?

... the weird thing is I got an email saying someone replied to this and I dont see anything.

This happened because a spammer replied to your thread, but then a moderator deleted their post.

Try the .htaccess file:

RewriteEngine On
RewriteRule		^([a-z0-9]+).html$		index.php?p=$1	[L]

Then, blah.html will redirect to index.php?p=blah

0

I have your code in there right now and its still not working. I almost positive that is something I have tried before also.

You can check it out at http://kbrlifestyles.com and just click on a link to see what I am talking about.

0

ok I see, so I actually need to change the link from "index.php?p=contact" to just "/contact"

This would not happen automatically?

0

There is nothing in the IT world which happens automatically.
To make the /contact link work, you'll first have to install the modification from my previous post.

0

Yeah, well it works. thats all that matters to me.

Thanks a bunch!!

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.