URL Rewriting Without mod_rewrite

Hello,

I’m trying to set up URL rewriting (which I’ve done many times before) using Apache mod_rewrite and it looks like .htaccess isn’t supported on this set up.

I’ve seen somewhere that you can set up rewriting using purely PHP, but I’m struggling to find any information on it. Can anyone point me in the right direction?

Cheers,

Jon

PHP alternative to mod_rewrite http://www.tutorio.com/tutorial/php-alternative-to-mod-rewrite-for-se-friendly-urls

That also relies on a .htaccess file.
As far as I know there is no way to create friendly URLs without using any form of .htaccess
I think you’d better contact the hoster to ask if .htaccess files are indeed disabled, and if they are, if they could enable them.
Are you server is Apache btw? If it’s IIS you could use a httpd.conf with ISAPI Rewrite. Provided they have installed that of course.

http://www.thyphp.com/friendly-url-without-mod_rewrite.html

Maybe that will help?

that’s true. and i suppose if the 404 page has an html extension you’d need to either change the 404 page to be used to a php one, or make it so that html extensioned files are parsed by the php parser, either way, .htaccess required. maybe the OP could request the hosting company to change the not found page to a file path of his choice. if so then it’d be possible.

no, you only send out 404 headers if the page really isn’t found. if it’s an address to be considered valid, you just don’t send out 404 headers from the page not found script.

Jon, how much access to the machine do you have? If you want to have your own not found page etc, you can make custom ones.

That technique is very bad for SEO since the server sends out 404 headers. Search engines assume the page does not exist

That assumes a PHP file can be used as the not found page. That is not necessarily the case, and if it isn’t it won’t work …

all requests which aren’t found go to a page not found page. put router-like code in that page’s script. so basically in the not found page, using php, get the url and include() the right file. bingo. no .htaccess file access required what so ever.

Yes, I’ve been using the exact same script for rewriting URL’s on brochure sites for well over a year, it’s rather well tested…

Thanks anyway,

Jon

Have you tried using this line in your .htaccess file before your rewrite statements?

RewriteEngine On

I’ve found out that it’s a Windows machine without Apache, so it looks like there will be no rewriting :frowning:

Cheers,

Jon

As I said above, if it’s an IIS server you may still be able to rewrite if they have ISAPI Rewrite installed as a module for IIS :slight_smile:
If they don’t, then there would indeed be no way to do rewrites …

same scripting url can be classified.